Nginx配置https网站

Posted dgjnszf

tags:

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

因为nginx默认从conf目录搜索https证书,所以https证书一般存放到conf目录下。

#省略一些配置
......

http {
    include        mime.types;
    default_type   application/octet-stream;
    sendfile       on;
    keepalive_timeout  65;
    charset   utf-8;

    server {
        listen  443;
        server_name   www.3n6mu.org;
        ssl   on;
        ssl_certificate        cert/3n6mu.org.crt; # https证书
        ssl_certificate_key    cert/3n6mu.org.key; # RSA私钥
        ssl_session_timeout   5m;
        ssl_protocols   TLSv1.2;
        ssl_ciphers    HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers   on;
        location / {
            root   html;
            index  index.html index.php;
        }
    }
}

#省略一些配置
......

 

以上是关于Nginx配置https网站的主要内容,如果未能解决你的问题,请参考以下文章