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

真诚赞赏,手留余香
赞赏
随机推荐
当async/await遇上forEach
Git命令文本手册
Windows下,Apache防止ddos攻击,安装配置mod_evasive模块
macOS下禁止Chrome更新
新媒体工作者的日常
微信步步为营,百度节节溃败
发送header文件头信息实现文件下载
javascript获取当前时间
V8引擎、 libuv 和 N-API
20170120 数位板 进步