mufdvr Asked:2020-08-28 00:03:32 +0800 CST2020-08-28 00:03:32 +0800 CST 2020-08-28 00:03:32 +0800 CST 将子域绑定到同一 IP 上的端口 772 有 foo.example.com 和 bar.example.com 指向同一个 IP,分别打开端口 8080 和 8081,nginx 在其上运行。例如,当访问 foo.example.com 时,如何在没有重定向的情况下在端口 8080 上打开服务器? proxy 1 个回答 Voted Best Answer Rootware 2020-08-28T01:50:02+08:002020-08-28T01:50:02+08:00 或多或少是这样的: server { listen 80; server_name foo.example.com; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_pass http://127.0.0.1:8080; } } 所以: server { listen 80; server_name bar.example.com; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_pass http://127.0.0.1:8081; } } 我希望8080你有一个抽象的例子,因为 SSL 代理是不同的。
或多或少是这样的:
所以:
我希望
8080
你有一个抽象的例子,因为 SSL 代理是不同的。