"Online, etc." How does this address rewrite?

Source: Internet
Author: User
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!!!
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.