server {
    listen 80;
    server_name hermes.fetcherpay.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name hermes.fetcherpay.com;

    ssl_certificate     /etc/letsencrypt/live/hermes.fetcherpay.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/hermes.fetcherpay.com/privkey.pem;

    # Required for SSE — disable buffering
    proxy_buffering off;
    proxy_cache off;
    chunked_transfer_encoding on;

    location / {
        proxy_pass http://localhost:3456;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Connection '';
        proxy_read_timeout 3600s;
    }
}
