server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    listen 8448 ssl http2;
    listen [::]:8448 ssl http2;
    server_name matrix.secretbee.buzz;

    ssl_certificate /etc/letsencrypt/live/matrix.secretbee.buzz/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/matrix.secretbee.buzz/privkey.pem;

    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    add_header X-Content-Type-Options nosniff;
    add_header X-Frame-Options DENY;
    add_header X-XSS-Protection "1; mode=block";

    proxy_buffering off;

    gzip on;
    gzip_types application/json;
    gzip_min_length 1000;

    location /_matrix/ {
        proxy_pass http://continuwuity_server;

        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_read_timeout 60s;
        proxy_send_timeout 60s;
    }
}