Example of nginx forward proxy configuration

June 27, 2021 330 point heat 0 liked it 1 comment

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 119.29.29.29;            # Configure DNS for domain name resolution resolver_ timeout 5s;              # Domain name resolution timeout (5 seconds) listen 8079;                    # Listening 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;        # If the URL contains "." Post nginx 503 error proxy_ buffers 256 4k;            # Configure cache size proxy_ max_ temp_ file_ size 0;      # Turn off disk cache read and write to reduce I / O proxy_ connect_ timeout 30;        # Proxy connection timeout proxy_ cache_ valid 200 302 0m; proxy_ cache_ valid 301 0h; proxy_ cache_ valid any 0m;            # Configure proxy cache time } }

Test:

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

 

Gcod

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

Article review

  • ChuHai5

    Praise a......

    September 29, 2021