I want to implement user requests
x.com/api/dosomething
Forward to the root directory of the Web site
/api.php
Processing.
Files that do not exist are given to
/index.php
Processing, nginx configuration is as follows
if (!-e $request_filename) { rewrite (.*) /index.php$1 last; }location ^~ /api/{ rewrite (.*) /api.php$1 last;}location ~ (index|api|admin).php { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }
But I found that when the visit was matched, the order of the alignment was x.com/api/dosomething
! -e $request_filename
not used, how should I configure
Reply content:
I want to implement x.com/api/dosomething
the processing that the user request forwards to the Web site root directory /api.php
.
Non-existent files are given /index.php
to the processing, nginx configuration is as follows
if (!-e $request_filename) { rewrite (.*) /index.php$1 last; }location ^~ /api/{ rewrite (.*) /api.php$1 last;}location ~ (index|api|admin).php { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }
But I found that when the visit was matched, the order of the alignment was x.com/api/dosomething
! -e $request_filename
not used, how should I configure
I look at the configuration right ah, I try to say in the local ...