Proxy_pass and Regular Expression

Source: Internet
Author: User

Proxy_pass and regular expression I tried to use if, location to process some URLs, and then allowed to proxy_pass to repeatedly try to prompt the following error www.2cto.com nginx: [emerg] "proxy_pass" cannot have URI part in location given by regular expression, or inside named location, or inside "if" statement, or inside "limit_0000t" block in/etc/nginx/conf. d/info.mydomain.com. conf: 112? Nginx: configuration file/etc/nginx. conf test failed finally found that using the $ request_uri variable can solve the above problem. www.2cto.com if ($ request_uri ~ "^/\ W + \. xml $") {proxy_pass http://www.mydomain.com/xml?request_uri=break;} if ($ request_uri ~ "^/Public/datas/\ w + \. xml $") {proxy_pass http://www.mydomain.com/?request_uri=break ;}

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.