NGinx Best Practices

Posted by The Pixel Developer on Server Fault See other posts from Server Fault or by The Pixel Developer
Published on 2009-06-03T18:13:09Z Indexed on 2010/03/21 18:31 UTC
Read the original article Hit count: 624

Filed under:
|
|
|

What best practices do you use while using NGinx?

try_files in Subdirectory

Credits go to Igor for helping me with this one.

location /wordpress {
    try_files $uri $uri/ @wordpress;
}

location @wordpress {
   fastcgi_pass 127.0.0.1:9000;
   fastcgi_split_path_info ^(/wordpress)(/.*)$;
   fastcgi_param SCRIPT_FILENAME /var/www/wordpress/index.php;
   fastcgi_param PATH_INFO $fastcgi_path_info;
}

Normally PATH_INFO would include the "/wordpress", so we use the "split_path_info" command to grab the part of the URI after "/wordpress". This allows us to wordpress with and without the index.php file.

© Server Fault or respective owner

Related posts about httpd

Related posts about nginx