nginx http和https共存

 

server {

    listen 80 default backlog=2048;

    listen 443 ssl;

    server_name linuxyan.com;

    root /var/www/html;

    ssl_certificate /usr/local/Tengine/sslcrt/linuxyan.com.crt;

    ssl_certificate_key /usr/local/Tengine/sslcrt/linuxyan.com.key;

}

 

把ssl on;这行去掉,ssl写在443端口后面。这样http和https的链接都可以用,完美解决。

posted on 2019-04-01 16:34  dongruiha  阅读(1393)  评论(0编辑  收藏  举报

导航