Welcome! Log In Create A New Profile

Advanced

Replacing the php regex with try_files?

December 17, 2010 02:08AM
Hi all,

Right now I use this type of configuration:
[code]
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
}
[/code]

My goal is to eliminate the regex on php file names:
[code]
location / {
try_files $uri $uri/ @php;
}
location @php {
try_files $uri.php /index.php?q=$uri&$args /404.html;
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
}
[/code]

I'm not sure if this is the correct way to do it. Any suggestions are welcome.
Subject Author Posted

Replacing the php regex with try_files?

TECK December 17, 2010 02:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 238
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