NGINX反代获取真实IP
反代获取真实IP
1 | proxy_set_header Host $host; # 传递原始请求的Host头 |
安全增强配置
1 | real_ip_header X-Forwarded-For; # 指定从哪个头获取真实IP |
- Title: NGINX反代获取真实IP
- Author: 清夏晚风
- Created at : 2026-01-13 16:48:23
- Updated at : 2026-01-13 16:48:23
- Link: https://blog.kimikkorow.eu.org/网站服务器/NGINX/NGINX反代获取真实IP/
- License: This work is licensed under CC BY-NC-SA 4.0.