【问题标题】:nginx reverse to all pagesnginx反向到所有页面
【发布时间】:2020-08-12 20:50:36
【问题描述】:

我有以下仅适用于 1 页的配置:

  location /mypage.html/ {
    proxy_pass http://${remote_server}/;
    }

当我尝试导航到远程服务器上的其他页面时,我得到页面未找到。 有没有办法让远程服务器上的所有页面都保持反向代理打开?

【问题讨论】:

    标签: nginx web proxy reverse-proxy


    【解决方案1】:

    这将匹配所有内容,技术上以/ 开头的所有内容,并将相同的请求路由到您的远程服务器:

    location / {
        proxy_pass http://${remote_server}/;
    }
    

    【讨论】:

      猜你喜欢
      • 2014-08-13
      • 1970-01-01
      • 2013-06-18
      • 2016-11-15
      • 2018-03-28
      • 1970-01-01
      • 2014-09-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多