nginx代理,后端web获取用户真实ip
·
1 分钟阅读
·
Web 基础设施
后台nginx服务器
log_format main ‘$http_x_forwarded_for - $remote_user [$time_local] “$request” ’ ‘$status $body_bytes_sent “$http_referer” ’ ’“$http_user_agent”’;
取消注释access_log
前段代理服务器:
server {
listen 10.12.23.67;
server_name filestore.tr.com;
location /
{
proxy_set_header Host $host;
proxy_pass
http://myproject
;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
}
}
#nginx
相关文章
-
wwoss 2018-07-11 10:57:55 1397 收藏 一个正确配置的 HTTPS 网站应该在证书中包含完整的证书链。 比如以 openssl sclient-connect x.x.x.x:443 命令来查看 自己的网站配置。
Web 基础设施 · 5 分钟阅读
-
2018年03月06日 16:05:52 jayzhen 阅读数:161 标签: nginx conf 更多 个人分类: linux nginx 版权声明:本文为博主原创文章,未经博主允许不得转载。
Web 基础设施 · 3 分钟阅读
-
Leebor 关注 2017.10.12 16:39 字数 258 阅读 1444 评论 0 喜欢 0 部分内容摘抄自 Nginx官网 Syntax: location [ = | ~ | ~ | ^~ ] uri { ... } location @name { ...
Web 基础设施 · 3 分钟阅读
-
2017 年 6 月 14 日 17:00 Nginx 反向代理、负载均衡、页面缓存、URL重写及读写分离详解 2013-09-04 14:45:43 标签: 读写分离 页面缓存 URL重写 Nginx 反向代理 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。 否则将追究法律责任。
Web 基础设施 · 55 分钟阅读