小编Har*_*ari的帖子

使用nginx将多个端口转发到单个端口

我想代理将来自一系列端口的所有请求传递到单个端口。我能够代理将单个端口传递给另一个端口,如下所示:

server {
    listen 3333;
    server_name test.in *.test.in;

    location / {
        proxy_pass  http://10.1.1.2:5479/;
        include /etc/nginx/proxy_params;
    }
}
Run Code Online (Sandbox Code Playgroud)

因此,当我尝试 test.in:3333 时,它会重定向到 10.1.1.2:5479。

以同样的方式,我需要代理传递这些:

test.in 4440 to 10.1.1.2:5479
test.in 4441 to 10.1.1.2:5479  
test.in 4442 to 10.1.1.2:5479   
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?

nginx reverse-proxy

6
推荐指数
2
解决办法
2万
查看次数

标签 统计

nginx ×1

reverse-proxy ×1