Nginx强制http转向到https访问
点击数:88692015-05-13 10:39:05 来源: 中国数字证书CHINASSL
新闻摘要:Nginx强制使用https,nginx重定向https访问
Nginx强制http转向到https访问
server { listen 80; server_name ssl.chinasslnet; rewrite ^(.*) https://ssl.chinassl.net/$1 permanent; } server { listen 443; ssl on; ssl_certificate chinassl.crt; ssl_certificate_key chinassl.key; server_name ssl.chinassl.net; location / { } }
Nginx强制http定向到https访问最新代码,推荐使用
server { listen 80; server_name my.domain.com; return 301 https://$server_name$request_uri; } server { listen 443 ssl; server_name my.domain.com; [....] }
参考链接1:http://serverfault.com/questions/67316/in-nginx-how-can-i-rewrite-all-http-requests-to-https-while-maintaining-sub-dom
参考链接2:http://wiki.nginx.org/Pitfalls#Taxing_Rewrites
本文连接地址: https://www.chinassl.net/faq/n565.html
强制HTTPS访问相关连接:
上一页1下一页 |
原文标题:Nginx强制http转向到https访问
原文地址:https://www.chinassl.net/faq/n565.html
版权所有@转载请注明出处:CHINASSL[https://www.chinassl.net]
原文地址:https://www.chinassl.net/faq/n565.html
版权所有@转载请注明出处:CHINASSL[https://www.chinassl.net]
【责任编辑:中国数字证书CHINASSL】
(Top) 返回页面顶端