apache2反向代理Google

由于众所周知的原因,Google在TC无法访问.以前看到有使用Nginx来反向代理Google的,今天尝试了下使用apache来反向代理Google,下面贴出配置方式.

<VirtualHost _default_:443>
    ServerAdmin root@lylinux.org
    DocumentRoot /var/www/
    ServerName google.lylinux.org:443

    Options -Indexes


    SSLEngine On 
    SSLProtocol all -SSLv2
    SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM

    SSLCertificateKeyFile /etc/apache2/ssl/www.lylinux.org.key 
    SSLCertificateFile  /etc/apache2/ssl/www.lylinux.org.crt 
    SSLCACertificateFile /etc/apache2/ssl/root_bundle.crt

    SetEnvIf User-Agent ".*MSIE.*" \
        nokeepalive ssl-unclean-shutdown \
        downgrade-1.0 force-response-1.0

    SSLProxyEngine On
    RequestHeader set Front-End-Https "On"
    ProxyPass / https://www.google.com/
    ProxyPassReverse / https://www.google.com/
</VirtualHost>
<Virtualhost *:80>
    ServerAdmin mail@lylinux.org
    DocumentRoot /var/www/
    ServerName google.lylinux.org:80
    RewriteEngine On
    RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R,L]
</VirtualHost>

证书的话可以用自己的VPS来生成就可以了,也可以申请免费的CA证书.我使用的就是沃通的免费证书.

发表评论

电子邮件地址不会被公开。 必填项已用*标注