Nginx Location Proxy Pass

Source: Internet
Author: User
Tags nginx reverse proxy

Nginx:192.168.1. 23 as Nginx reverse proxy machine target machine 192.168.1. 5 Deploy a 8090-port Nginx[[email protected] CONF.D]#Cat test.confServer {Listen80; server_name localhost;location/{root/var/www/Html;index index.html;} Location/proxy/{proxy_pass http:192.168.1.5:8090/;}} To access http:192.168.1.23/proxy/will be proxied to http://192.168.1.5:8090/, the URL of the browser is http://192.168.1.23/proxy/Unchanged , there is no need to have a proxy directory on the target machine (Curl http:192.168.1.23/Proxy can be found to be 302,301 redirect) if: Proxy_pass the configured URL is not added after"/"[[email protected] CONF.D]#Cat test.confServer {Listen80; server_name localhost;location/{root/var/www/Html;index index.html;} Location/proxy/{proxy_pass http:192.168.1.5:8090;}} Then access http:192.168.1.23/proxy or http://192.168.1.23/proxy/, it will fail! After this configuration, access to http:192.168.1.23/proxy/will be reverse proxy to http://192.168.1.5:8090/proxy/, the target must have a proxy directory

Fast Memory: Proxypass finally if the band/, then the agent to the target machine there is no location behind the directory, without/, to the target after carrying the directory behind the location, together with the past

Nginx Location Proxy Pass

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.