    map $http_upgrade $connection_upgrade {
        default upgrade;
        ''      close;
    }

    server {
        listen          80;
        listen          [::]:80;

        location / {
            proxy_pass          http://host.docker.internal:9998;
            proxy_set_header    Upgrade $http_upgrade;
            proxy_set_header    Connection $connection_upgrade;
            proxy_set_header    Host            $host;
            proxy_set_header    X-Real-IP       $remote_addr;
            proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    }

    server {
        listen 443 ssl http2;

        ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
        ssl_certificate_key /etc/ssl/certs/nginx-selfsigned.key;

        location / {
            gzip on;
            gzip_min_length  1100;
            gzip_buffers  4 32k;
            gzip_types    text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml  application/rss+xml font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml;
            gzip_vary on;
            gzip_comp_level  6;

            proxy_pass          http://host.docker.internal:9998;
            http2_push_preload on;
            proxy_http_version 1.1;
            proxy_connect_timeout 60s;
            proxy_read_timeout 60s;
            proxy_send_timeout 60s;
            proxy_buffer_size 4k;
            proxy_buffering on;
            proxy_buffers 8 4k;
            proxy_busy_buffers_size 8k;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $http_connection;
            proxy_set_header Host $http_host;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header X-Forwarded-Port $server_port;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Request-Start $msec;

        }
    }
