在我的用例中,我必须通过反向代理访问api网关。 这样的事情: (用户 - > Httpd(EC2) - > api网关 - > lambda)
我能够在我的api网关和我的虚拟机EC2之间创建一个vpc-link(它完美地工作)。
但第二部分是创建一个服务器httpd,它将把来自其他网络的请求重定向到我的api网关。
但我的httpd服务器似乎无法正常工作 这里错误
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /myapi/.
Reason: Error reading from remote server
这里是我的httpd配置
<VirtualHost *:443>
# Use HTTP Strict Transport Security to force client to use secure connections only
Header always set Strict-Transport-Security "max-age=300; includeSubDomains; preload"
ServerAdmin administrator@test.net
ServerName www.test.net
ServerAlias test.net
DocumentRoot /var/www/html/test.net/public_html/
SSLEngine on
SSLCertificateFile /etc/httpd/selfsigned/server.crt
SSLCertificateKeyFile /etc/httpd/selfsigned/server.key
SSLProxyEngine On
ProxyPass /myapi/ https://apigateway.amazonaws.com/ retry=1 acquire=3000 timeout=24000 Keepalive=On
ProxyPassReverse /myapi/ https://apigateway.amazonaws.com/
ProxyPreserveHost On
</VirtualHost>
注意:lambda函数返回一个简单的响应。
你知道吗?提前谢谢