Original address:
Http://172.16.46.40/api/handler.php/user/1/get_info/6
Now it needs to be configured in Nginx to finally get the result, that is
can be accessed by
HTTP://172.16.46.40/API/USER/1/GET_INFO/6 as normal access, how to configure in Nginx?
Reply to discussion (solution)
if (-f $request _filename) {
Break
}
# otherwise rewrite it
if (!-e $request _filename) {
Rewrite ^ (. +) $/handler.php?_url=$1 last;
Break
}
if (-f $request _filename) {
Break
}
# otherwise rewrite it
if (!-e $request _filename) {
Rewrite ^ (. +) $/handler.php?_url=$1 last;
Break
}
No, really, now appear directly: File not found, that red box is my URL pathinfo
That's how I use it.
if (-f $request _filename) {
Break
}
# otherwise rewrite it
if (!-e $request _filename) {
Rewrite ^ (. +) $/handler.php?_url=$1 last;
Break
}
Even if it is left under the PathInfo I configured, it is not possible, either 404, or 500 error!!!
If you put the wrong place yourself, you can't blame someone else.
Location/{ index index.html index.htm index.php; if (-e $request _filename) {break ; } if (!-e $request _filename) { rewrite ^ (. +) $/handler.php?_url=$1 last; break; } }
If you put the wrong place yourself, you can't blame someone else.
Location/{ index index.html index.htm index.php; if (-e $request _filename) {break ; } if (!-e $request _filename) { rewrite ^ (. +) $/handler.php?_url=$1 last; break; } }
Good!!!