Debian

Apache 反向代理 SSL 問題

  • April 15, 2021

我在我的主機名上https://servername/phpmyadmin/安裝了phpmyadmin。我想更改 url 並“採用”域證書並在其上使用它db.domain.tld,但我無法讓它工作。

這是我的 ProxyPass 在ISPConfig主機名中的配置,其中11.22.33.44是伺服器 IP 的佔位符。

ProxyRequests off
SSLProxyEngine on
ProxyPassReverseCookiePath /phpmyadmin/ /
ProxyPassReverseCookieDomain 11.22.33.44 db.domain.tld

ProxyPass "/" https://11.22.33.44/phpmyadmin/ connectiontimeout=10000 timeout=10000
ProxyPassReverse "/" https://11.22.33.44/phpmyadmin/

這是我在錯誤日誌中得到的錯誤

[Tue Feb 18 09:18:57.640945 2020] [proxy:error] [pid 7804:tid 139734462269184] [client IPv6-placeholder:44762] AH00898: Error during SSL Handshake with remote server returned by /
[Tue Feb 18 09:18:57.640950 2020] [proxy_http:error] [pid 7804:tid 139734462269184] [client IPv6-placeholder:44762] AH01097: pass request body failed to 11.22.33.44:443 (11.22.33.44)

我的瀏覽器中的響應是

Proxy Error
The proxy server could not handle the request

Reason: Error during SSL Handshake with remote server

忘記添加解決方案。這是時間之後。

TimeOut 10000

SSLProxyEngine on
SSLProxyVerify none 
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
RewriteRule ^ - [END]
RewriteCond %{HTTPS} !=On [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

ProxyRequests off
ProxyPassReverseCookiePath /phpmyadmin/ /
ProxyPassReverseCookieDomain servername.host.tld db.domain.tld

ProxyPass "/" https://servername.host.tld/phpmyadmin/ connectiontimeout=10000 timeout=10000
ProxyPassReverse "/" https://servername.host.tld/phpmyadmin/

引用自:https://unix.stackexchange.com/questions/568226