使用SSH内网穿透加Nginx反向代理之后获取真实IP 发表于 2018-08-06 | 分类于 系统运维 | 配置Nginx123456789location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. # try_files $uri $uri/ =404; proxy_pass http://localhost:8080; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host;} 重新加载Nginx配置: 1nginx -s reload JAVA获取IP1String ip = request.getHeader("X-Real-IP"); 打赏 支付宝