frp nginx反向代理 获取真实ip
5月前

frp本地设置:

[[proxies]]
name = "web"
type = "http"
localPort = 8086
customDomains = ["www.xiabk.com"]
transport.proxyProtocolVersion = "v2"

 

前段nginx 设置:

       location / {
		proxy_ssl_server_name on;
       		 proxy_pass http://127.0.0.1:8090;
		root   html;
		index  index.html index.htm;
		
		proxy_set_header    Host            $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header REMOTE-HOST $remote_addr;
		add_header X-Cache $upstream_cache_status;expires 12h;

 
        }

后端nginx设置

server {
        listen        8086 proxy_protocol;
        server_name  127.0.0.1;
        root   "D:/WWW/www.xiabk.com";
       set_real_ip_from 127.0.0.1;
       real_ip_header X-Forwarded-For;
       real_ip_recursive on;

 

 

 

 

 

 

最新回复 (1)
返回