修改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>访问:

nginx 正向代理

客户机添加代理:

nginx 正向代理

结果:

nginx 正向代理

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

nginx 正向代理

转载于:https://blog.51cto.com/anonxiaozi/1679692

相关文章:

  • 2022-01-07
  • 2021-08-28
  • 2021-06-26
  • 2021-07-26
  • 2021-09-25
  • 2022-01-07
  • 2022-01-07
  • 2021-10-07
猜你喜欢
  • 2021-12-19
  • 2022-01-05
  • 2019-07-15
  • 2021-11-18
  • 2022-01-15
  • 2021-07-09
  • 2022-01-01
相关资源
相似解决方案