DISQUS

DISQUS Hello! Random Musings is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Jump to original thread »
Author

NginX Reporting for Duty

Started by hadar · 1 year ago

Last week, my friend Jamie Thingelstad tweeted from the Rails Conference that he was considering switching to NginX (I’ll probably drop the caps starting now) after sitting in on a session about it.

Prior to that mention, I had only heard of it once, when an inter ... Continue reading »

8 comments

  • >Specifically, if can’t be used within a regular expression based if test, even if you aren’t using variable substitution in the proxy_pass itself.

    It seems that you just should not use if()s in nginx.conf for such kind of things, it is rather slow and not intended for request-uri case handling; it is supposed to be used in specific cases like user-agent checks etc.

    use regexp locations instead.

    to avoid copy-pasting, put some directives to the server{} level, or use the include directive.
  • Good to know! There are cases where the logic could/would be simpler with if's, but I hear ya. Thanks for sharing!
  • yeah dude - php-fpm is the best way to go for fastcgi management (soon to be even better) and nginx i am discovering is hands down the best way to do any web proxying or web serving. it has a couple minor things i've realized are annoying (and surprised that it hasn't been fixed before) but otherwise i've been extremely happy with the switch.
  • Cool! I'm part of the Google group now for php-fpm, so I'll see any announcements about newer versions, and look forward to checking them out. Thanks for letting me know!
  • Wow! Thanks for doing this writeup Hadar! I do plan to switch to nginx but don't want to do it until I return home in July. Seems like it will take a bit of doing. This post is going to be a huge help when doing it. Thanks for taking the time.
  • I'm super happy with NginX and separately with PHP-FPM. I am running many vservers as well, and it's trivial to manage them all. When you're ready, please don't hesitate to holler if I can help in any way! :-)
  • I heard some chatter from people saying that Wordpress on nginx is "noticeably" faster than on Apache and that they even disabled WP-Cache as a result. You see any big jumps in performance?

    I'm going to get a RoR app setup via nginx as well. Seems really slick to have nginx on front with PHP-FPM and Mongrel.

    The thing that confuses me the most about nginx is how to handle wordpress nice URL's. I saw lots of fright from people about the lack of mod_rewrite. You seem okay though, yes?
  • To me, my blog seems to load a ton faster, but that could be that somehow php-fpm is faster than mod_php (though, I assume that both are resident, so it may be more due to nginx).

    As for mod_rewrite, it's actually a one-liner in nginx. Basically, if the URI doesn't exist on the filesystem (that's the part I screwed up initially, entirely my fault!), then you simply pass it as a parameter to index.php in the blog root.

    Works like a charm, no matter what the permalink structure on your site. It's beautifully simple. :-)

Add New Comment

Returning? Login