# Production shape for browser -> nginx -> upl -> local filesystem. # # Replace server_name, certificate paths, and access control before exposing # this app. Keep upl itself bound to 127.0.0.1. upstream upl_backend { server 127.0.0.1:3000; keepalive 16; } server { listen 443 ssl http2; server_name uploads.example.com; ssl_certificate /etc/letsencrypt/live/uploads.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/uploads.example.com/privkey.pem; client_max_body_size 64m; # Add HTTP basic auth, an IP allowlist, VPN-only access, or another # protection layer before exposing this personal upload tool publicly. # auth_basic "upl"; # auth_basic_user_file /etc/nginx/upl.htpasswd; # Expose only completed uploads. Keep UPL_TEMP_DIR outside every nginx # alias/root so in-progress temp files and progress markers are private. location /files/ { alias /srv/upl/data/complete/; autoindex on; try_files $uri =404; } location / { proxy_pass http://upl_backend; proxy_http_version 1.1; proxy_request_buffering off; proxy_buffering off; proxy_read_timeout 3600s; proxy_send_timeout 3600s; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Real-IP $remote_addr; } }