【问题标题】:Jersey + Grizzly behind Apache reverse proxy - Resource not foundApache 反向代理背后的 Jersey + Grizzly - 找不到资源
【发布时间】:2018-06-15 13:31:12
【问题描述】:

我有一个基于球衣的 REST 应用程序,它在 grizzly 上运行,并在 apache 反向代理后面配置如下 例如www.example.com/base/json/helloworld/get 应该重定向到我的 REST 服务。 (多种资源)。但是,当我尝试在浏览器中打开 url 时,总是找不到资源。

在我的 apache 配置中:

ProxyPass /base/ http://localhost:8123/
ProxyPassReverse /base/ "http://localhost:8123/

我的 grizzly 服务器配置非常简单,如果我发出 curl 请求就可以工作: curl localhost:8123/base/json/helloworld/get => 响应正确。
但是,如果我在浏览器中访问 url,例如 example.com/base/json/helloworld 我收到了灰熊错误:

路径 /json/helloworld/get' 标识的资源不存在。

 HttpServer server = GrizzlyHttpServerFactory.createHttpServer(URI.create(http://localhost:8123/base), resourceConfig, false);

我错过了什么吗?我已经尝试将 url 更改为域等,但我无法理解为什么它不起作用。

【问题讨论】:

    标签: apache reverse-proxy jersey-2.0 grizzly


    【解决方案1】:

    我发现了我的错。在 grizzly 服务器中,我的 url 配置了路径 /base/,但代理通行证没有在 url 的末尾包含 /base/ 路径。现在它工作正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-01-23
      • 2017-07-09
      • 1970-01-01
      • 1970-01-01
      • 2021-04-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多