Example of nginx forward proxy configuration

June 27, 2021 242 point heat 0 liked it 0 comments

Nginx forward proxy configuration reference is applicable to intranet servers connecting to the Internet through proxy,

Strictly speaking, it may not meet the requirements of the equal insurance 2.0

 ##HTTP proxy configuration example server{ Resolver; ා configure DNS for domain name resolution Resolver ᦇ timeout 5S; # domain name resolution timeout (5 seconds) Listen 8079; listen port access_log  /usr/local/nginx/logs/reverse.access.log  main; error_log   /usr/local/nginx/logs/reverse.error.log  warn; location / { Proxy ᦇ pass http: / / $http ﹥ host $request ᦇ URI; # configure forward proxy parameters Proxy ﹣ set ﹣ header host $http ᦇ host; ᦇ solves the nginx 503 error if the URL contains "." Proxy ᦇ buffers 256 4K; # configure cache size Proxy ﹣ Max ﹣ temp ﹤ file ᦇ size 0; ᦇ turn off disk cache read / write to reduce I / O Proxy connect timeout 30 proxy_cache_valid 200 302 0m; proxy_cache_valid 301 0h; Proxy cache valid any 0m; configure proxy cache time } }


 curl  http://ip.vv1234.cn/  -x 172.xx.xx.211:8079



If life is just like the first sight, what is the sad autumn wind painting fan

Article review