簡體   English   中英

Apache proxypass https到https

[英]Apache proxypass https to https

這是我厭倦了做的事情:

  1. browser -internet-> https(Apache proxypass)-intranet - >(Apache https)
  2. 兩個Apaches都安裝了ssl證書。(startssl wide card,not self-signed)

Apache錯誤日志:

[client 192.168.2.157] SSL Proxy requested for test.xxx.com:443 but not enabled [Hint: SSLProxyEngine]

[error] proxy: HTTPS: failed to enable ssl support for 192.168.2.157:443 (test.xxx.com)

然后我嘗試使用apache(在互聯網上)代理到https://google.com並且錯誤日志是相同的。

但是,https到http工作。 browser -internet-> https(Apache proxypass)-intranet - >(Apache http)

我的配置:

<VirtualHost  *:443>
    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/xxx_com.crt
    SSLCertificateKeyFile /etc/apache2/ssl/xxx_com.key
    SSLCertificateChainFile /etc/apache2/ssl/sub.class2.server.ca.pem
    ProxyPreserveHost On
    ProxyRequests Off
    ProxyVia Off
    AllowEncodedSlashes NoDecode
    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>
    ProxyPass  /       https://2w.xxx.com/
    ProxyPassReverse   /       https://2w.xxx.com/
    ServerName test.xxx.com
    RequestHeader set X-Forwarded-Proto "https"
    RequestHeader set X-Forwarded-Port "443"
    ErrorLog "/var/log/apache2/error-ssl.log"
</VirtualHost>

要么:

<VirtualHost  *:443>
    ProxyPass  /       https://google.com/
    ProxyPassReverse   /       https://google.com/
    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/xxx_com.crt
    SSLCertificateKeyFile /etc/apache2/ssl/xxx_com.key
    SSLCertificateChainFile /etc/apache2/ssl/sub.class2.server.ca.pem
    ServerName test.xxx.com
</VirtualHost>

似乎apache不可能將https處理為https? 如果apache不支持這個nginx怎么樣?

您應該設置“SSLProxyEngine On”。 以下是我的例子,可能會給你任何想法。

<VirtualHost *:443>
    SSLEngine On
    SSLProxyEngine On
    ServerName my.example.com:443
    SSLCertificateFile "${SRVROOT}/conf/ssl/example.pem"
    SSLCertificateKeyFile "${SRVROOT}/conf/ssl/example.key"
    ErrorLog "|bin/rotatelogs.exe -l /var/logs/apache/example/error.%Y-%m-%d.log 86400"
    CustomLog "|bin/rotatelogs.exe -l /var/logs/apache/example/ssl_request.%Y-%m-%d.log 86400" \
        "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

    ProxyRequests Off
    ProxyPass / https://www.google.com/
    <Location />
        ProxyPassReverse /

        Options FollowSymLinks
        Require all granted
    </Location>   
</VirtualHost>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM