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
声明:本站所有文章和图片,如无特殊说明,均为原创发布。商业转载请联系作者获得授权,非商业转载请注明出处。