nginx extensionless php url without if statement -


i use config:

root /www/mysite/static location / {     try_files $uri @php; } location @php {     fastcgi_pass 127.0.0.1:9000;     include fastcgi_params;     fastcgi_param script_filename /www/mysite/controller$fastcgi_script_name.php; } 

this first check if /www/mysite/static has file. if can't find file, run fastcgi on "file.php".

now if go www.mysite.com/asdf, try run fastcgi /www/mysite/controller/asdf.php, doesn't exist.

i read if statement evil, should instead?

finally figured out:

location /info {     root /usr/share/nginx/www;     fastcgi_pass unix:/var/run/php5-fpm.sock;     include fastcgi_params;     fastcgi_param script_filename /usr/share/nginx/www/info.php; } 

actually makes sense i've bothered read documentation...


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -