1. 程式人生 > >Nginx白名單設置

Nginx白名單設置

nginx白名單設置 nginx設置 白名單設置 nginx

Nginx白名單設置

vim langba888.conf
server {
listen 80;
server_name www.langba888.com;
allow 192.168.137.52; #只允許該ip訪問,其他拒絕
deny all;

location / {
    proxy_pass http://192.168.137.52:999;               #反向代理到後端的ip+端口
    proxy_set_header   Host                          $host;
    proxy_set_header   SiteCode                "langba";       
    proxy_set_header   X-Real-IP               $remote_addr;        
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto  $scheme;
}

}

Nginx白名單設置