美文网首页
Nginx 配置SSL及Http跳转到Https 不带www跳转

Nginx 配置SSL及Http跳转到Https 不带www跳转

作者: _Net_ | 来源:发表于2021-12-29 15:43 被阅读0次

server {

  listen 80;

       server_name  abc.com www.abc.com;

    return 301 https://www.abc.com$request_uri;

}

  server {

      listen 443;

      server_name abc.com;

      return 301 https://www.abc.com$request_uri;

}

  server {

        listen  443 default_server ssl;

        server_name www.abc.com;

        root  "E:/php/PHPTutorial/WWW/geyu/public";

ssl                  on;

        ssl_certificate      E:\cert\cert.pem;

        ssl_certificate_key  E:\cert\cert.key;

        ssl_session_timeout  5m;

        #ssl_protocols  SSLv2 SSLv3 TLSv1; 原来的

ssl_protocols  SSLv2 SSLv3 TLSv1 TLSv1.1 TLSv1.2;

        ssl_ciphers  HIGH:!aNULL:!MD5;

        ssl_prefer_server_ciphers  on;

        location / {

            index  index.html index.htm index.php;

            #autoindex  on;

if (!-e $request_filename) {

      rewrite ^(.*)$ /index.php?s=/$1 last;

      break;

  }

相关文章

网友评论

      本文标题:Nginx 配置SSL及Http跳转到Https 不带www跳转

      本文链接:https://www.haomeiwen.com/subject/cnbvqrtx.html