Welcome! Log In Create A New Profile

Advanced

Cleaning up my configs with try_files in Nginx 0.8.54-4

Posted by Xeoncross 
Cleaning up my configs with try_files in Nginx 0.8.54-4
October 13, 2011 05:57PM
After following the (http://wiki.nginx.org/Pitfalls) guide I am trying to cleanup my URL rewrites using the try_files directive. However, when using this on my install of Nginx 0.8.54-4 (from dotdeb) I get a prompt to download a BIN file when trying to access the site (which contains the source of the index.php PHP script). So are any of these directives not compatible with my version of nginx?


server {
listen 80;
server_name site.loc;
root /home/user/www/site.loc/docroot;
index index.html index.php;

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

# Pass all .php files to PHP-FastCGI
location @runphp {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}
}



Edited 1 time(s). Last edit at 10/13/2011 05:58PM by Xeoncross.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 284
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready