zoukankan      html  css  js  c++  java
  • nginx ssl 配置

    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 Apache's document root
        # concurs with nginx's 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;
        }
    }
  • 相关阅读:
    小素典会员订阅协议
    vue项目自动构建工具1.0,支持多页面构建
    spring boot 框架根據 sql 創建語句自動生成 MVC層類代碼
    使用 docsify 創建自己的 markdown 文檔系統
    “衣”及其部分屬字
    js原型鏈與js繼承解析
    js 中怎么获取session 值和HTML标签的属性值
    layui table动态表头 改变表格头部 重新加载表格的方法
    throw throws Throwable 关联于区别
    静态代理和动态代理的区别和联系
  • 原文地址:https://www.cnblogs.com/xiondun/p/13588226.html
Copyright © 2011-2022 走看看