美文网首页
nginx 基于x-forward-for做白名单

nginx 基于x-forward-for做白名单

作者: getsu | 来源:发表于2018-05-09 15:49 被阅读0次

    配置如下:

           location  / {
             ## set_real_ip_from 为上级代理ip
             set_real_ip_from 10.0.0.0/8;
             real_ip_header  X-Forwarded-For;
             real_ip_recursive on;
             ## 白名单
             allow 172.0.0.0/8;
             deny all;
          }
    

    相关文章

      网友评论

          本文标题:nginx 基于x-forward-for做白名单

          本文链接:https://www.haomeiwen.com/subject/ssxorftx.html