Nginx configuration Proxy_pass Forwarding/path problem

Source: Internet
Author: User

Nginx Configuration Proxy_pass Forwarded/Path issues domestic private equity jiuding Holdings create app to send $20 cash pickup Address: http://jdb.jiudingcapital.com/phone.html Internal Invite code: C8E245J (do not write the invitation code, no cash to send) domestic private equity institutions jiuding Holdings, jiuding Investment is the national share transfer system listed public company, the stock code is 430719, As "China PE first share", the market value of over 100 billion yuan. --------------------------------------------------------------------------------------------------------------- ---------------------------------------------------nginx configuration Proxy_pass forwarded/path problem when configuring Proxy_pass in Nginx, if you are following^~ match path, pay attention to Proxy_pass URL after the last/, when added/, equivalent to the absolute root path, the Nginx will not be the location of the matching path part of the agent away;, the matching path portion is also given to the agent. Location^~/static_js/{Proxy_cache js_cache;  Proxy_set_header Host js.test.com; Proxy_pass http://js.test.com/; }as the above configuration, if the requested URL is http://servername/static_js/test.html will be proxied as http://js.test.com/test.htmland if you configure location so^~/static_js/{Proxy_cache js_cache;  Proxy_set_header Host js.test.com; Proxy_pass http://js.test.com; }will be proxied to http://js.test.com/static_js/test.htmOf course, we can use the following rewrite to achieve/the function location^~/static_js/{Proxy_cache js_cache;  Proxy_set_header Host js.test.com; rewrite/static_js/(. +) $/$1  Break; Proxy_pass http://js.test.com; } 

Nginx configuration Proxy_pass Forwarding/path problem

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.