我想在 Apache 中使用反向代理将 AWS APIGateway URL 放在前面。原因是由于一个过程需要静态 IP 来在严格的防火墙后面提供服务,并且当前的基础架构已经安装了 mod_proxy。我希望实现的解决方案是简单地通过 mod_proxy 路由 https->https(apiGateway)。
但是.. AWS 使用 SNI,我无法让 mod_proxy 握手。
我启用了以下设置
<IfModule mod_ssl.c>
<VirtualHost *:443>
ProxyPreserveHost On
SSLProxyEngine On
ProxyPass /api/1_0/ https://xxx.execute-api.eu-west-1.amazonaws.com/1_0/
ProxyPassReverse /api/1_0/ https://xxx.execute-api.eu-west-1.amazonaws.com/1_0/
Run Code Online (Sandbox Code Playgroud)
以下日志在调试模式下可用
proxy_util.c(2020): AH00942: HTTPS: has acquired connection for (xxx.execute-api.eu-west-1.amazonaws.com)
proxy_util.c(2610): AH00962: HTTPS: connection complete to 52.x.x.x:443 (xxx.execute-api.eu-west-1.amazonaws.com)
AH01964: Connection to child 0 established (server domain.com:443)
AH02003: SSL Proxy connect failed
SSL Library Error: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
AH01998: Connection closed to child 0 with abortive …Run Code Online (Sandbox Code Playgroud)