0

我是 NGINX 的新手,正在尝试设置代理。我有一个具有以下设置的测试环境:

  • NGINX 监听 4433 端口。
  • 公共端口 443 由路由器转发到端口 4433(朝向 NGINX)

我准备了一个测试服务器并在 NGINX 中为它设置了一个位置

location /test1/ {
    proxy_pass https://192.168.5.54/;
    proxy_redirect off;

    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
}

我的问题是通过访问https://mydomain/test1返回https://mydomain:4433/test1/,因此无法访问该站点,因为浏览器期望端口 443 上的响应。我不知道如何设置 NGINX 以返回端口 443。

欢迎任何帮助!谢谢!

非常感谢

4

0 回答 0