Apache开启SSL,并代理Node.js的配置文件和80端口的跳转

apache开启SSL,并代理Node.js的配置文件,还有www.的跳转,和80端口的跳转。

# javascript.net.cn
<VirtualHost *:443>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "d:/htdocs/cn_net_javascript"
    ServerName javascript.net.cn
    ServerAlias www.javascript.net.cn

    # 代理
    ProxyRequests off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
    <Location />
        ProxyPass http://127.0.0.1:3000/
        ProxyPassReverse http://127.0.0.1:3000/
    </Location>
    
    # 开启SSL
    SSLEngine on
	SSLProtocol all -SSLv2
	SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
	SSLCertificateFile "D:/htdocs/cn_net_javascript/_ssl/javascript.net.cn.crt"
	SSLCertificateKeyFile "D:/htdocs/cn_net_javascript/_ssl/javascript.net.cn.key"
	SSLCertificateChainFile "D:/htdocs/cn_net_javascript/_ssl/javascript.net.cn-ca-bundle.crt"
	<FilesMatch "\.(cgi|shtml|phtml|php)$">
		SSLOptions +StdEnvVars
	</FilesMatch>

    # www.跳转
	RewriteEngine on
	RewriteCond %{HTTP_HOST} ^www.javascript.net.cn [NC]
	RewriteRule ^(.*) https://javascript.net.cn/ [L]
</VirtualHost>

# 80端口跳转
<VirtualHost *:80>
    ServerName javascript.net.cn
    ServerAlias www.javascript.net.cn
    RewriteEngine on
	RewriteCond %{HTTP_HOST} ^javascript.net.cn [OR]
	RewriteCond %{HTTP_HOST} ^www.javascript.net.cn
	RewriteRule ^(.*) https://javascript.net.cn/ [L]
</VirtualHost>

 

修改时间 2018-04-25

真诚赞赏,手留余香
赞赏
随机推荐
把Apache ModSecurity的攻击日志存储到MySQL
node.js 的 module.exports 和 exports 的区别
Nginx 报错 nginx accept() failed (24: Too many open files)
Javascript网页打印大全
php和Javascript修改图片路径
WordPress 不使用插件开发 RESTful API JWT 授权和验证
MySQL 函数 concat、concat_ws 和 group_concat
三点运算符
一个页面中多个window.onload = function(){}冲突问题解决思路
webpack使用vue与cordova