upstream example_upload_backend {
    server 127.0.0.1:8090;
}

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    http2 on;
    server_name upload.example.com;

    include /etc/nginx/snippets/tls-example.conf;
    include /etc/nginx/snippets/security-headers.conf;
    include /etc/nginx/snippets/hsts.conf;

    client_max_body_size 2g;
    client_body_timeout 5m;
    send_timeout 5m;
    limit_conn conn_per_ip 5;

    location /upload {
        limit_except POST PUT { deny all; }
        proxy_pass http://example_upload_backend;
        include /etc/nginx/snippets/proxy-common.conf;
        proxy_request_buffering off;
        proxy_buffering off;
        proxy_send_timeout 5m;
        proxy_read_timeout 5m;
    }
}
