美文网首页
Nginx Guide

Nginx Guide

作者: Jedore | 来源:发表于2018-10-31 10:37 被阅读0次
 return       301 https://$host$request_uri;
listen       443 ssl;
ssl_certificate ./conf.d/214184177510235.pem;
ssl_certificate_key ./conf.d/214184177510235.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout  10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
  • Example
    server {
        listen       80;
        server_name  xxx.com www.xxx.com;
        return       301 https://$host$request_uri;
    }
    
    server {
        listen       80;
        server_name  xxx.xxx.com;

        location / {
                    proxy_pass http://127.0.0.1:xxxx;
        }
        error_page 404 /404.html;
            location = /40x.html {
        }
        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
    
    server {
        listen       443 ssl;
        # listen       [::]:443 ssl http2 default_server;
        server_name  xxx.com;
        root         /usr/share/nginx/html;

        ssl_certificate ./conf.d/xxxxxxxxxxxxxx.pem;
        ssl_certificate_key ./conf.d/xxxxxxxxxxxxxx.key;
        ssl_session_cache shared:SSL:1m;
        ssl_session_timeout  10m;
        ssl_ciphers HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers on;

        location / {
                        proxy_pass http://127.0.0.1:xxxx;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

相关文章

网友评论

      本文标题:Nginx Guide

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