2026-11-17 11:57:45 +01:00
|
|
|
# One address for everything: broke, plus the two Supabase services it needs, on the same origin.
|
|
|
|
|
# The browser and broke's server both reach Supabase at PUBLIC_URL/auth/v1 and PUBLIC_URL/rest/v1.
|
2026-11-17 15:16:53 +01:00
|
|
|
|
|
|
|
|
# Behind a reverse proxy that does https (Nginx Proxy Manager, SWAG, Caddy...), keep what it says, so return links
|
|
|
|
|
# for bank feeds come out as https. Reached directly, it's this server's own scheme and host.
|
|
|
|
|
map $http_x_forwarded_proto $fwd_proto {
|
|
|
|
|
default $http_x_forwarded_proto;
|
|
|
|
|
"" $scheme;
|
|
|
|
|
}
|
|
|
|
|
map $http_x_forwarded_host $fwd_host {
|
|
|
|
|
default $http_x_forwarded_host;
|
|
|
|
|
"" $http_host;
|
|
|
|
|
}
|
|
|
|
|
|
2026-11-17 11:57:45 +01:00
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
client_max_body_size 25m; # statement uploads
|
|
|
|
|
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
2026-11-17 15:16:53 +01:00
|
|
|
proxy_set_header X-Forwarded-Proto $fwd_proto;
|
|
|
|
|
proxy_set_header X-Forwarded-Host $fwd_host;
|
2026-11-17 11:57:45 +01:00
|
|
|
|
|
|
|
|
# Supabase Auth (GoTrue). Admin routes still need the service role key.
|
|
|
|
|
location /auth/v1/ {
|
|
|
|
|
proxy_pass http://auth:9999/;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Supabase REST (PostgREST). Row-level security decides what each user sees.
|
|
|
|
|
location /rest/v1/ {
|
|
|
|
|
proxy_pass http://rest:3000/;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location / {
|
|
|
|
|
proxy_pass http://broke:3000;
|
|
|
|
|
proxy_buffering off; # AI answers stream
|
|
|
|
|
proxy_read_timeout 300s;
|
|
|
|
|
}
|
|
|
|
|
}
|