Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js NGINX:相同域但不同端口的多个代理传递_Node.js_Ssl_Nginx_Networking_Localhost - Fatal编程技术网

Node.js NGINX:相同域但不同端口的多个代理传递

Node.js NGINX:相同域但不同端口的多个代理传递,node.js,ssl,nginx,networking,localhost,Node.js,Ssl,Nginx,Networking,Localhost,情况如下: 我有多达500个独立的本地主机应用程序,所有这些应用程序都在服务器上同时运行。我的路由器有80、443、8000到8500个端口打开。我的客户端可以连接到他们选择的每个不同的本地主机应用程序。我的任务是找到一种方法,使用1个域:example.com 如果我可以使用查询字符串告诉NGINX要重定向到哪个应用程序,那就太好了。例如,如果example.com是我的域名,并且我打开了端口443来连接它,那么如果我可以执行以下操作,那就太好了: 然后NGINX将此请求重定向到localh

情况如下:

我有多达500个独立的本地主机应用程序,所有这些应用程序都在服务器上同时运行。我的路由器有80、443、8000到8500个端口打开。我的客户端可以连接到他们选择的每个不同的本地主机应用程序。我的任务是找到一种方法,使用1个域:example.com

如果我可以使用查询字符串告诉NGINX要重定向到哪个应用程序,那就太好了。例如,如果example.com是我的域名,并且我打开了端口443来连接它,那么如果我可以执行以下操作,那就太好了:

然后NGINX将此请求重定向到localhost:8300

如果无法做到这一点,另一个解决方案可以是请求:

然后NGINX将这个请求重定向到localhost:8300

我当前的设置在端口443上重定向到localhost:8080(NGINX配置代码:)

服务器{

    server_name example.com;

    location / {
            proxy_pass http://localhost:8080/;
    }

listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by
Certbot ssl_certificate_key/etc/letsencrypt/live/example.com/privkey.pem;#由管理 Certbot include/etc/letsencrypt/options-ssl-nginx.conf;#由Certbot管理 ssl_dhparam/etc/letsencrypt/ssl-dhparams.pem;#由Certbot管理

    listen 80;
    listen [::]:80;

    server_name example.com;
return 404; # managed by Certbot
}服务器{ 如果($host=example.com){ 返回301 https://$host$request\u uri; }#由Certbot管理

    listen 80;
    listen [::]:80;

    server_name example.com;
return 404; # managed by Certbot
}

但我需要一系列代理传递参数,它们需要对应于查询字符串或域名的端口

我没有找到关于如何做到这一点的文档或在线文章。谢谢