nginx配置ssl和http2

moonjerx
2021-08-06 / 0 评论 / 230 阅读 / 正在检测是否收录...
    server {
        listen       80;
        listen 443 ssl http2;
        server_name oss.xxxxxx.com;
        client_max_body_size 2048M;
        index index.html index.htm index.php default.html default.htm default.php;
        charset utf-8;
        
        #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
        #error_page 404/404.html;
        ssl_certificate    E:/applications/nginx-1.20.1/conf_new/certs/oss/fullchain.pem;
        ssl_certificate_key    E:/applications/nginx-1.20.1/conf_new/certs/oss/privkey.pem;
        ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
        ssl_ciphers ECCBH+CHACHA20:EECDH+CHACHA20-draft:ECCBH+AES128:RSA+AES128:ECCBH+AES256:RSA+AES256:ECCBH+3DES:RSA+3DES:!MD5;
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 10m;
        add_header Strict-Transport-Security "max-age=31536000";
        
        
        location / {
            #proxy_set_header  Host $host;
            proxy_set_header  Host $http_host;
            proxy_set_header  Connection keep-alive;
            proxy_set_header  X-Real-IP $remote_addr;
            proxy_set_header x-forwarded-for $remote_addr;
            proxy_pass http://192.168.3.53:21032;
            proxy_http_version 1.1;    #添加
            proxy_set_header Upgrade $http_upgrade;    #添加
            proxy_set_header Connection "upgrade";    #添加
        }
        access_log  E:/applications/nginx-1.20.1/conf_new/logs/oss.log;
        error_log  E:/applications/nginx-1.20.1/conf_new/logs/oss.error.log;
    }
0

评论 (0)

取消

您的IP: