【问题标题】:how to configure apache server to talk to HTTPS backend server?如何配置 apache 服务器与 HTTPS 后端服务器通信?
【发布时间】:2014-09-26 06:37:23
【问题描述】:

我将 apache 服务器配置为反向代理,如果我将后端服务器设置为 HTTP,它就可以正常工作。那就是:

我将虚拟主机 443 配置为:

ProxyPass /primary/store http://localhost:9763/store/
ProxyPassReverse /primary/store http://localhost:9763/store/

这里用户将像https://localhost/primary/store一样访问服务器

这很好用……但我想配置 HTTP 服务器,例如;

ProxyPass /primary/store https://localhost:9443/store/
ProxyPassReverse /primary/store https://localhost:9443/store/

当我像 apache 服务器一样配置时,会出现 500 内部服务器错误。我在这里做错了什么?

我得到的错误是:

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, you@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

在 apache 错误日志中指出;

nt: SSLProxyEngine]
[Mon Aug 04 00:03:26 2014] [error] proxy: HTTPS: failed to enable ssl support for [::1]:9443 (localhost)
[Mon Aug 04 00:03:31 2014] [error] [client ::1] SSL Proxy requested for localhost:443 but not enabled [Hint: SSLProxyEngine]
[Mon Aug 04 00:03:31 2014] [error] proxy: HTTPS: failed to enable ssl support for [::1]:9443 (localhost)
[Mon Aug 04 00:03:51 2014] [error] [client ::1] SSL Proxy requested for localhost:443 but not enabled [Hint: SSLProxyEngine]
[Mon Aug 04 00:03:51 2014] [error] proxy: HTTPS: failed to enable ssl support for [::1]:9443 (localhost)

如何配置http服务器与HTTPS服务器通信?

【问题讨论】:

    标签: apache httpd.conf


    【解决方案1】:

    您的服务器会准确地告诉您您需要什么:[Hint: SSLProxyEngine]

    您需要将该指令添加到 VirtualHost 之前的 Proxy 指令:

    SSLProxyEngine on
    ProxyPass /primary/store https://localhost:9763/store/
    ProxyPassReverse /primary/store https://localhost:9763/store/
    

    See the doc for more detail.

    【讨论】:

    • 感谢完美运行..我错过了将 SSLProxyEngine 放在参数上。
    • 我的 SSLProxyEngine 已打开,并且 ssl 模块已启用,但仍然得到 [Tue Nov 17 12:19:39.061224 2015] [proxy:error] [pid 8381:tid 140148180240128] AH00961: HTTPS: failed to为 182.161.73.67:443 (gum.criteo.com) 启用 ssl 支持
    • [2015 年 11 月 17 日星期二 12:19:40.322610] [ssl:error] [pid 5485:tid 140148287219456] [远程 103.229.140.67:443] AH01961:为 localhost:80 请求 SSL 代理但不是启用 [提示:SSLProxyEngine]
    • 谢谢...只需在 httpd-ssl.conf 文件中的 SSLEngine on 之后添加 SSLProxyEngine on 就可以了!
    • 大家好...如何仅在 Apache 具有所需证书的情况下代理请求?谢谢
    【解决方案2】:

    在我的情况下,我的服务器被配置为仅在 https 模式下工作,当我尝试访问 http 模式时发生错误。所以将http://my-service 更改为https://my-service 会有所帮助。

    【讨论】:

      猜你喜欢
      • 2015-04-30
      • 2015-07-29
      • 1970-01-01
      • 2014-02-22
      • 2015-11-03
      • 1970-01-01
      • 2022-01-16
      • 1970-01-01
      • 2010-09-19
      相关资源
      最近更新 更多