1. 程式人生 > >nginx反向代理後獲取不到客戶端的真實ip地址

nginx反向代理後獲取不到客戶端的真實ip地址

location / {

   proxy_pass http://127.0.0.1:10678;

   proxy_set_header Host $host;

//加入下面配置

        proxy_set_header X-Real-IP $remote_addr;

        proxy_set_header REMOTE-HOST $remote_addr;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }