nginx 获取实时ip请求地址

修改nginx conf文件夹下 nginx.conf文件,在http{}的配置中,添加如下代码

proxy_set_header Host $http_host;
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;

posted @ 2022-06-21 18:08  xionghaizhi  阅读(581)  评论(0编辑  收藏  举报