nginx端口转发需要特殊模块实现貌似现在转发很多都是http协议那就可以用反代配合ddns
server
#ddns反代
{
#本地转发监听端口
listen 17778;
resolver 8.8.8.8 valid=600s;
resolver_timeout 1s;
#需要中转的落地鸡域名和端口
set $proxy_pass_url http://8yy.com:8018; #域名:端口
location / {
proxy_pass $proxy_pass_url;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
Comments | NOTHING