server {
    listen 80;
    server_name kubesphere.cloud;
    return 301 https://$host$request_uri;
}
map $http_upgrade $connection_upgrade {
      default upgrade;
      '' close;
}
server {
    listen 443 ssl http2;
    server_name  kubesphere.cloud;
    index  index.html index.htm index.php;

    ssl_certificate  /root/.acme.sh/kubesphere.cloud/fullchain.cer;
    ssl_certificate_key  /root/.acme.sh/kubesphere.cloud/kubesphere.cloud.key;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';

    ## send request back to apache ##
    location / {
        proxy_pass http://127.0.0.1:30880; 
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_read_timeout 86400;

        #proxy_redirect     off;
        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        proxy_max_temp_file_size 0;
        proxy_connect_timeout      90;
        proxy_send_timeout         90;
        #proxy_read_timeout         90;
        proxy_buffer_size          4k;
        proxy_buffers              4 32k;
        proxy_busy_buffers_size    64k;
        proxy_temp_file_write_size 64k;
    }
    location ~ /\. {
       deny all;
    }
}
最后修改日期: 2022年3月3日

作者