【问题标题】:Nginx proxy pass without the location url on proxy_passNginx 代理通行证,没有 proxy_pass 上的位置 url
【发布时间】:2021-08-27 06:51:10
【问题描述】:

我正在尝试在 nginx 中代理传递。这是配置的样子:

location /amazon {
        proxy_pass http://amazon.com;
    }

当我打开 domain.com/amazon 时,它会将我带到 amazon.com/amazon。我应该如何编写它以便只打开 amazon.com,而不打开 /amazon。

【问题讨论】:

    标签: nginx nginx-reverse-proxy nginx-config nginx-location


    【解决方案1】:

    只需在proxy_pass 中添加一个斜杠即可:

    proxy_pass http://amazon.com/;
    

    这表示您要访问根 (/) 位置。

    【讨论】:

      猜你喜欢
      • 2020-06-09
      • 1970-01-01
      • 1970-01-01
      • 2014-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-26
      相关资源
      最近更新 更多