Skip to content

fix(dev2): raise proxy_buffer_size in the site vhost template - #112

Merged
ralyodio merged 1 commit into
masterfrom
fix/dev2-vhost-proxy-buffer-size
Sep 28, 2026
Merged

ralyodio merged 1 commit into
masterfrom
fix/dev2-vhost-proxy-buffer-size

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Every successful Supabase login behind a dev2 vhost 502s: nginx upstream sent too big header (sb-*-auth-token Set-Cookie chunks exceed the default proxy_buffer_size; buffering off does not change that). Adds proxy_buffer_size 64k; proxy_buffers 8 64k; proxy_busy_buffers_size 128k; to the vhost template (also inherited by proxy blocks such as supabase.).

Evidence from /var/log/nginx/error.log on 2026-09-28: ugig.net POST /api/auth/login x955, ugig.net GET /auth/confirm x34, www.pairux.com POST /api/auth/login x11, supabase.brisk.news GET /rest/v1/short_urls x148.

After merge, live vhosts need re-rendering (backs up to .bak-NNN, runs nginx -t, reloads):

for s in ugig.net pairux.com brisk.news; do dev2/dev2-site vhost $s; done

(ideally every site, since 79/81 vhosts lack the directive).

🤖 Generated with Claude Code

Supabase SSR auth sets several chunked sb-*-auth-token cookies on a
successful sign-in; nginx's default 4k/8k proxy_buffer_size cannot hold
them, logs "upstream sent too big header" and answers 502. Failed logins
set no cookies, so they 401 cleanly and the site looks healthy.

On 2026-09-28 alone dev2's error log has 955 such ugig.net logins, 34
ugig.net /auth/confirm (email confirmation) clicks, 11 pairux logins and
148 supabase.brisk.news REST calls. 79 of 81 enabled vhosts set no
proxy_buffer_size. Proxy blocks are cut from the same template, so they
pick this up too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

25 finding(s)

HIGH/CRITICAL: 4 | MEDIUM: 12 | LOW: 9

Severity Rule Location
HIGH sh-remote-script-execution root-ubuntu.sh:3236
HIGH sh-remote-script-execution root-ubuntu.sh:3237
HIGH sh-remote-script-execution root-ubuntu.sh:5071
HIGH sh-remote-script-execution root-ubuntu.sh:5075
MEDIUM sql-template-interpolation dev2/dev2-site:805
MEDIUM sql-template-interpolation dev2/dev2-site:882
MEDIUM sh-remote-script-execution root-ubuntu.sh:5248
MEDIUM redos-nested-quantifier src/domain-free.ts:56
MEDIUM redos-nested-quantifier src/emoji.ts:167
MEDIUM redos-nested-quantifier src/icon.ts:166
MEDIUM redos-nested-quantifier src/mail.ts:1042
MEDIUM sql-template-interpolation src/users-dump.ts:487
MEDIUM sql-string-concatenation src/users-dump.ts:507
MEDIUM sql-template-interpolation src/users-dump.ts:540
MEDIUM sql-string-concatenation src/users-dump.ts:574
MEDIUM redos-nested-quantifier src/wcag.ts:556
LOW secret-generic-credential src/credentials.ts:36
LOW secret-generic-credential src/user-export.ts:632
LOW secret-generic-credential src/user-export.ts:638
LOW secret-generic-api-key test/credentials.test.ts:208
LOW secret-generic-credential test/mail.test.ts:141
LOW secret-generic-credential test/shorten.test.ts:36
LOW secret-database-url test/users-dump.test.ts:108
LOW secret-database-url test/users-dump.test.ts:119
LOW secret-database-url test/users-dump.test.ts:120

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 6b126c0 into master Sep 28, 2026
5 checks passed
@ralyodio
ralyodio deleted the fix/dev2-vhost-proxy-buffer-size branch September 28, 2026 18:57
ralyodio added a commit that referenced this pull request Sep 28, 2026
… kit (#113)

Two vhosts could not be re-rendered, so they missed the proxy_buffer_size
fix (#112):

- r4ck.dev carries a hand-added ThreatCrush x402 paywall location that a
  re-render would delete. sites.d may now set nginx_locations (raw location
  blocks, __APP_PORT__ substituted), inserted ahead of the catch-all; the
  paywall block moves into sites.d/r4ck.dev.json.
- bittorrented.com is not a Railway site, so it has no sites.json row and
  `dev2-site vhost` died "unknown site". site() now falls back to a sites.d
  file that names itself, and nginx_app: false renders only the proxies
  (its app runs on a droplet; only supabase.bittorrented.com is here).

Proxy tuning moved into proxy_tuned(). Dry run against dev2: 74 vhosts
render byte-identical to live; these two differ only by the buffer lines.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant