# Reverse proxy for the `next` environment (Caddy obtains the certificates). Adjust the upstream addresses # to the containers (docs/ARCHITECTURE.md, Infrastructure). { # Archives' own addresses (docs/archive.md): a certificate only for a host the API knows. on_demand_tls { ask http://pr-api:3000/v1/archive/host } } app.next.photoreport.pt { # The SPA (static build in /var/www/photoreport-app/current); the engine's WASM needs its media type. root * /var/www/photoreport-app/current @wasm path *.wasm header @wasm Content-Type application/wasm try_files {path} /index.html file_server } api.next.photoreport.pt { # REST, signed file URLs and Socket.io (/v1/realtime, websockets pass through). reverse_proxy pr-api:3000 request_body { # Chunks of resumable uploads are 4 MB; single-request uploads up to 200 MB. max_size 210MB } } # Public sites: every brand domain goes to the same Next.js server; the API picks the skin by domain. next.photoreport.pt, shootyourmove.next.photoreport.pt, events.next.photoreport.pt { reverse_proxy pr-site:3100 { header_up X-Forwarded-Host {host} } } # An archive's own address ("arquivo.ligaportugal.pt", set in the app): any other host whose DNS points here. # The site looks the host up and serves that archive at the root. https:// { tls { on_demand } reverse_proxy pr-site:3100 { header_up X-Forwarded-Host {host} } }