DISQUS

Random Musings: NginX Reporting for Duty

  • fixxxer · 1 year ago
    >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.
  • hadar · 1 year ago
    Good to know! There are cases where the logic could/would be simpler with if's, but I hear ya. Thanks for sharing!
  • mike · 1 year ago
    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.
  • hadar · 1 year ago
    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!
  • thingles · 1 year ago
    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.
  • hadar · 1 year ago
    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! :-)
  • thingles · 1 year ago
    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?
  • hadar · 1 year ago
    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. :-)