修改nginx配置文件如下(在location中添加:proxy_set_header x-forwarded-for $remote_addr;)
server {
listen 80;
server_name www.zhangshan.top;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_set_header x-forwarded-for $remote_addr;
proxy_pass http://localhost:8084;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
本文详细介绍了如何修改Nginx配置文件,通过在location中添加proxy_set_header x-forwarded-for $remote_addr;来实现特定的功能。同时,展示了完整的server块配置,包括监听端口、服务器名称、错误页面设置及根目录定位。
1582

被折叠的 条评论
为什么被折叠?



