nginx问题请教下,如何端口转发到虚拟目录
就是把端口转发成虚拟目录来访问比如说内网用 transmission 来BT下载,需要IP+端口来使用, http://192.168.31.x:9091 但一堆端口不好记,怎样可以转发成 http://192.168.31.x/bt/ 这样虚拟目录来访问?
当然还有调试各种源码程序,也不想记一堆端口,用公网 IP + 虚拟目录,代替端口实现
网上没找到专门讲这样,找了类似来抄,发现不对,请问哪里出错,应该怎么改?
[*]location ^~ /bt/ {
[*] client_max_body_size 1024m;
[*] proxy_http_version 1.1;
[*] proxy_set_header Upgrade $http_upgrade;
[*] proxy_set_header Connection "Upgrade";
[*] proxy_set_header Host $http_host;
[*] proxy_set_header X-Real-IP $remote_addr;
[*] proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
[*] proxy_set_header X-Forward-Proto $scheme;
[*] proxy_redirect off;
[*] proxy_pass http://127.0.0.1:9091;
[*]}
[*]复制代码
location ^~/ttyd {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
proxy_redirect off;
proxy_pass http://127.0.0.1:7681;
# the max size of file to upload
client_max_body_size 20000m;
}
页:
[1]