# Cap on exe.dev: https://exe.dev/deploy/cap # Port 8000 is https://.exe.xyz/. Cap's web app gets everything except # /cap/, the storage bucket, which goes straight to MinIO so that share # links, Cap Desktop and the browser can fetch and upload video with Cap's # signed URLs. Email sign-in is for the owner only; everyone else is # turned away, so nobody else can make an account or guess a code. # Who the owner is, and the secret Cap expects with them (mode 600). include /home/exedev/cap/owner.conf; server { listen 8000; listen [::]:8000; server_name _; absolute_redirect off; client_max_body_size 0; proxy_http_version 1.1; proxy_read_timeout 300s; proxy_send_timeout 300s; # For Cap (every location below except /cap/, which sets its own). proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-Host $http_host; # exe.dev's proxy appends the visitor's address, which Cap reads # from the last entry for its rate limits. proxy_set_header X-Forwarded-For $http_x_forwarded_for; # Set only for the owner, signed in to exe.dev; empty values (and # anything a client sent in these headers) are never passed on. proxy_set_header X-Cap-Exe-Owner $cap_owner; proxy_set_header X-Trusted-Proxy-Secret $cap_owner_secret; location /cap/ { proxy_pass http://127.0.0.1:9000; proxy_set_header Host $http_host; proxy_request_buffering off; proxy_buffering off; } # Sign in to Cap as the owner with your exe.dev login. location = /exe-login { if ($http_x_exedev_email = "") { return 302 /__exe.dev/login?redirect=/exe-login; } if ($cap_owner = "") { return 403 "Only the VM's owner can sign in here.\n"; } default_type text/html; alias /var/www/cap/exe-login.html; } # Email sign-in codes (web, share pages and Cap's mobile API): only for # the owner, signed in to exe.dev, to make the account. location ~ ^/api/(auth/(signin|callback)/email|mobile/session/email/) { default_type text/plain; if ($cap_owner = "") { return 403 "Email sign-in is off. The owner signs in at /exe-login.\n"; } proxy_pass http://127.0.0.1:3000; } location / { proxy_pass http://127.0.0.1:3000; } }