简体   繁体   English

Apache proxypass https到https

[英]Apache proxypass https to https

here is what I tired to do: 这是我厌倦了做的事情:

  1. browser -internet-> https(Apache proxypass)-intranet->(Apache https) browser -internet-> https(Apache proxypass)-intranet - >(Apache https)
  2. both Apaches are installed the ssl certs.(startssl wide card,not self-signed) 两个Apaches都安装了ssl证书。(startssl wide card,not self-signed)

Apache error log: 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)

Then I tried use apache(on the internet) proxy to https://google.com and the error log is the same. 然后我尝试使用apache(在互联网上)代理到https://google.com并且错误日志是相同的。

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

My config: 我的配置:

<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>

OR: 要么:

<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>

Seems like it's not possible for apache to handle https to https? 似乎apache不可能将https处理为https? if apache does not support this how about nginx? 如果apache不支持这个nginx怎么样?

You should set "SSLProxyEngine On". 您应该设置“SSLProxyEngine On”。 The following is my example that may give you any idea. 以下是我的例子,可能会给你任何想法。

<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