• 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;
        }
    }
  • 相关阅读:
    WebApi接口返回值不困惑:返回值类型详解
    Autofac 依赖注入框架 使用
    ASP.NET Core:使用Dapper和SwaggerUI来丰富你的系统框架
    ASP .Net Core 使用 Dapper 轻型ORM框架
    基于AspNet Core2.0 开发框架,包含简单的个人博客Demo
    Asp.Net MVC及Web API框架配置会碰到的几个问题及解决方案 (精髓)
    精简版自定义 jquery
    vs code 前端如何以服务器模式打开 [安装服务器] server insteall
    RestSharp用法小结
    翻译:WebApi 认证--用户认证Oauth解析
  • 原文地址:https://www.cnblogs.com/xiondun/p/13588226.html
Copyright © 2020-2023  润新知