【问题标题】:Nginx route all rest of the PathNginx 路由路径的所有其余部分
【发布时间】:2021-12-28 02:48:05
【问题描述】:

如果在 Nginx/AWS-ALB 上可行,请告诉我们

需要在域上服务器静态主页 例如:example.com 将路由到主页

请求的所有其余部分都必须转发到 application-server/tomcat

example.com/abc ,example.com/xyz 等必须路由到 application-server/tomcat

我们没有任何通用的应用程序路由路径 有多条路线 如何配置将路径的所有其余部分路由到应用程序,除了主路径

【问题讨论】:

    标签: amazon-web-services nginx proxy routes reverse-proxy


    【解决方案1】:

    您可以使用= 修饰符为根路径定义完全匹配:

    location = / {
      # root path
    }
    location / {
      # everything else
    }
    

    ngx_http_core_module docs

    【讨论】:

      猜你喜欢
      • 2015-11-14
      • 2013-09-24
      • 1970-01-01
      • 2013-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多