server {
    server_name bingai.107421.xyz;
    listen 80 ;
    return 301 https://bingai.107421.xyz$request_uri;
}

server {
    listen 443 ssl;
    server_name    bingai.107421.xyz;

    ssl_certificate    /etc/nginx/conf.d/ssl_key/bingai.107421.xyz.cert.pem;
    ssl_certificate_key    /etc/nginx/conf.d/ssl_key/bingai.107421.xyz.key.pem;
    ssl_session_timeout 1d;
    ssl_session_cache shared:MozSSL:10m;
    ssl_session_tickets off;

    ssl_protocols   TLSv1.2 TLSv1.3;
    ssl_ciphers    ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
    ssl_prefer_server_ciphers off;

    location /sydney/ChatHub {
        proxy_http_version                 1.1;
        proxy_set_header Upgrade           $http_upgrade;
        proxy_set_header Connection        $connection_upgrade;
        proxy_set_header Host              $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host  $host;
        proxy_set_header X-Forwarded-Port  $server_port;
        proxy_pass http://150.230.198.103:18080;
    }

    location / {
        client_max_body_size 5120m;
        client_body_buffer_size 5120m;
        client_body_timeout 6000s;
        proxy_send_timeout 10000s;
        proxy_read_timeout 10000s;
        proxy_connect_timeout 600s;
        proxy_max_temp_file_size 5120m;
        proxy_request_buffering on;
        proxy_buffering off;
        proxy_buffer_size 4k;
        proxy_buffers 4 12k;

        proxy_set_header X-Forwarded-For 4.2.2.2;

        proxy_set_header Host              $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host  $host;
        proxy_set_header X-Forwarded-Port  $server_port;

        proxy_pass http://150.230.198.103:18080;
    }

    #配置静态资源 解决js css文件无法加载无法访问的问题，注意末尾不能有 /
    location ~ .*\.(js|css|jpg|jpeg|gif|png|ico|pdf|txt)$ {

      proxy_set_header Host              $host;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Forwarded-Host  $host;
      proxy_set_header X-Forwarded-Port  $server_port;

      proxy_pass http://150.230.198.103:18080;
    }

}
