当我尝试在 Apache2 中配置反向代理以将流量重定向到 Docker 容器时,无法解决此错误。
我看到网上有几个人试图调整timeout
参数ProxyPass
,但没有成功
问题是,当与端口 80 交互时,代理工作正常,无需 https,但一旦我使用端口 443 并尝试使其适用于 HTTPS 流量,它就会返回 502 代理错误,并显示以下消息Error reading from remote server returned by /
这是 mydomaine-le-ssl.conf 文件:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName mydomaine.tld
ProxyPreserveHost On
SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
ProxyPass / https://localhost:8081/ retry=1 acquire=3000 timeout=600 Keepalive=On
ProxyPassReverse / https://localhost:8081/
ProxyPassReverseCookieDomain locahost mydomaine.tld
ErrorLog /srv/logs/error/mydomaine.log
CustomLog /srv/logs/access/mydomaine.log combined
SSLCertificateFile /etc/letsencrypt/live/mydomaine.tld/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mydomaine.tld/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/mydomaine.tld/chain.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>