nginx配置常用 ( 反向代理时传客户端IP )

反向代理时传客户端IP

location / {
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Host $server_name;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_pass http://localhost:8000;
}

 参考:https://www.cnblogs.com/morgan363/p/12973800.html

 

posted @ 2021-06-21 14:37  程序生(Codey)  阅读(136)  评论(0编辑  收藏  举报