友情提示:欢迎光临!本地已启用二维码api网关,地址是https://api.slogra.com

nginx使用scheme配置http重定向到https

post by rocdk890 / 2017-12-15 16:30 Friday linux技术

相信现在很多朋友都已经在使用ssl证书来配置网站了,但由于http和https共存在一个配置文件里,很多人都想访问http的时候直接跳转到https,下面来看配置文件:
cat /etc/nginx/conf.d/www.slogra.com.conf
server {
        listen  80;
        listen  443 ssl;
        server_name www.slogra.com;
        root   /data/www/;
        index  index.php index.htm index.html;

	ssl on;
 ...

阅读全文>>

标签: nginx ssl 跳转 重定向 301 schema

评论(0) 引用(0) 浏览(9137)