nginx 正向代理 <备忘>

修改nginx配置文件:

server {
        listen 9999;
        location / {
                resolver        192.168.111.46;
                resolver_timeout        20s;
                proxy_pass      http://$host$request_uri;
        }
        access_log      /web/proxy/log/access.log;
}


测试:

server {
    listen       80;
    server_name  a.bloke.com;
    access_log  /web/a/log/access.log main;
    location / {
        deny    192.168.111.113;
        root   /web/a;
        index  index.html index.htm;
    }
}
客户机<113>访问:

wKiom1W4iLfBU2syAADDmf5Suwo112.jpg

客户机添加代理:

wKioL1W4iwLThQtFAADpfZwj0BU714.jpg

结果:

wKioL1W4iymQqvueAAB5h0nZXh4073.jpg

查看/web/proxy/log/access.log:

wKiom1W4ikzDGuQjAADEkgBmqps751.jpg

你可能感兴趣的:(nginx,正向代理)