nginx???http???https???????????????

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx???http???https???????????????相关的知识,希望对你有一定的参考价值。

??????????????????   baidu   md5   ??????   ??????   ??????   ????????????   style   listen   

???????????????????????????????????????www.baidu.com??????????????????https://www.baidu.com?????????????????????nginx????????????????????????????????????

?????????nginx???????????????????????????????????????80?????????443?????????????????????443????????????????????????????????????????????????????????????????????????

????????????????????????????????????????????????????????????????????????????????????https://www.cnblogs.com/wxzhe/p/10125513.html????????????????????????????????????????????????nginx??????????????????

nginx????????????????????????????????????server?????????????????????????????????http?????????

    server {                                #?????????server??????????????????80??????               
        listen       80;
        server_name  localhost;

        location  /{
            root   html;
            index  index.html index.htm;
            rewrite ^(.*)$  https://$host$1 permanent;     #????????????????????????????????????80?????????443??????????????????????????????????????????????????????????????????????????????
        }

    }
    server { #?????????server??????????????????443?????? listen
443 ssl; server_name localhost; ssl_certificate cert/server.pem; #?????????????????????????????????????????????????????????????????? ssl_certificate_key cert/server.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { root html; index index.html index.htm; } }

???????????????????????????http????????????????????????????????????https?????????

 


以上是关于nginx???http???https???????????????的主要内容,如果未能解决你的问题,请参考以下文章