Nodebb迁移:FRP内网穿透后,Nginx无法获取访客真实IP
-
Nginx日志
如图都是 127.0.0.1
FRPC修改
新增 transport.proxyProtocolVersion = "v2"
[[proxies]] name = "http" type = "tcp" localIP = "127.0.0.1" localPort = 80 remotePort = 80 transport.proxyProtocolVersion = "v2" [[proxies]] name = "https" type = "tcp" localIP = "127.0.0.1" localPort = 443 remotePort = 443 transport.proxyProtocolVersion = "v2"
Nginx修改
新增 proxy_protocol
server { listen 80 proxy_protocol; listen [::]:80 proxy_protocol; listen 443 ssl http2 proxy_protocol; listen [::]:443 ssl http2 proxy_protocol; real_ip_header proxy_protocol; real_ip_recursive on; set_real_ip_from 127.0.0.1; ......