Welcome! Log In Create A New Profile

Advanced

Nginx location for not exists php files

June 12, 2014 08:51AM
I have config(minimal):

server {
listen test.local:80;
server_name test.local;

server_name_in_redirect off;

location / {
root /data/www/test/public;
try_files $uri $uri/ /index.php?route=$uri&$args;
index index.html index.php;
}

location ~ \.php$ {
root /data/www/test/public;

fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME /data/www/test/public$fastcgi_script_name;
fastcgi_param ...
...
}
}
Thats work file for urls /help/ or /contacts/ etc(all redirect to index.php with get variabled).

But if url, for example, /help.php or contacts.php, and this files not exists, i have output

File not found.
How update my nginx config? I need urls, for example:

/help.php => /index.php?route=/help.php
/contacts.php?foo=bar... => /index.php?route=/contacts.php&args=...
Thanks a lot!
Subject Author Posted

Nginx location for not exists php files

Khmelevsky June 12, 2014 08:51AM

Re: Nginx location for not exists php files

Francis Daly June 12, 2014 02:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 72
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready