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