码迷,mamicode.com
首页 > 其他好文 > 详细

nginx ssl 配置

时间:2020-09-11 16:13:08      阅读:52      评论:0      收藏:0      [点我收藏+]

标签:red   prot   hpa   var   listening   api   bsp   protoc   pre   

server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;
    #access_log  /var/log/nginx/host.access.log  main;
    location /static/ {
        alias /var/www/api/laowai_panda/static/;
    }
    location /media/ {
        alias /var/www/api/laowai_panda/media/;
    }
    location = /download.html {
        root /var/www/api/laowai_panda/;
    }

    location / {
        include         uwsgi_params;
        uwsgi_pass      127.0.0.1:8000;
          client_max_body_size 200m;
    }


    #listen 443 ssl; # managed by Certbot
    #ssl_certificate /etc/letsencrypt/live/laowaipanda.com/fullchain.pem; # managed by Certbot
    #ssl_certificate_key /etc/letsencrypt/live/laowaipanda.com/privkey.pem; # managed by Certbot
    #include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    #ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    # deny access to .htaccess files, if Apaches document root
    # concurs with nginxs one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}
server {
    listen       443 ssl;
    server_name  laowaipanda.com;
    #ssl on;
    #charset koi8-r;
    #access_log  /var/log/nginx/host.access.log  main;
    location /static/ {
        alias /var/www/api/laowai_panda/static/;
    }
    location /media/ {
        alias /var/www/api/laowai_panda/media/;
    }
    location = /download.html {
        root /var/www/api/laowai_panda/;
    }

    location / {
        include         uwsgi_params;
        uwsgi_pass      127.0.0.1:8000;
          client_max_body_size 200m;
    }
    
    ssl_certificate  /etc/nginx/cert/4426061_www.laowaipanda.com.pem;
    ssl_certificate_key /etc/nginx/cert/4426061_www.laowaipanda.com.key;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

 

nginx ssl 配置

标签:red   prot   hpa   var   listening   api   bsp   protoc   pre   

原文地址:https://www.cnblogs.com/xiondun/p/13588226.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!