Request original address: http://servername/static_js/test.html
location ^~ /static_js/ { proxy_cache js_cache; proxy_set_header Host js.test.com; proxy_pass http://js.test.com/; } or use rewrite 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; }
Proxy as http://js.test.com/test.html
location ^~ /static_js/ { proxy_cache js_cache; proxy_set_header Host js.test.com; proxy_pass http://js.test.com; }
Proxy as http://js.test.com/static_js/test.htm
Domain jump to visit crm6yy_proxy.xxx.com Jump to crm6yy.xxx.com
1 2 3 4 5 6 7 8 9 10 11 |
|
forward proxy
Scenes
A cannot access the Internet
B can access the Internet (A and B can access each other)
C outside the website http://www.baidu.com
The nginx configuration on B is as follows
resolve 8.8.8.8; server { listen 8090; location / { proxy_pass $scheme://$http_host$request_uri; } }
use:
Access on machine A:
or curl -x B:8090 -k "C"
或者 export http_proxy="http://B:8090"
Or under windows: fill in the ip and port in internet options->connection->LAN settings->proxy server