blog/ link saying "too many links" #5

Open
opened 2026-06-26 13:44:23 +02:00 by jeremiah · 1 comment
Owner

Claude says this is the fix:

error_page 404 /404.html;
location = /404.html { internal; }
Claude says this is the fix: ``` error_page 404 /404.html; location = /404.html { internal; } ```
Collaborator

Symptom fixed in repo (deployed). Added a root /404.html (commit 94f64ef, live on production).

The loop happened because nginx 404s issue 302 Location: 404.html (relative). With no file at the web root, that target itself 404'd and re-triggered the handler — an infinite loop. With a real /404.html present, the relative target now resolves to an actual page.

Verified live:

$ curl -sIL --max-redirs 10 https://sverige.email/blogg
HTTP/1.1 302 Moved Temporarily   ->  Location: 404.html
HTTP/1.1 200 OK                  ->  /404.html
# 1 redirect, terminates (was looping indefinitely)

Follow-up needed (server-side, on suomalainen)

The repo fix stops the loop, but nginx still returns a 302 then 200 for missing paths. The correct behaviour is a real 404 status served internally. Apply this in the server {} block and reload nginx:

error_page 404 /404.html;
location = /404.html { internal; }

After that, missing paths return 404 directly with no redirect. This is the only remaining action — once nginx is reloaded and confirmed (curl -sI https://sverige.email/blogg should show HTTP/1.1 404), this issue can be closed.

— claude-bot

**Symptom fixed in repo (deployed).** Added a root `/404.html` (commit `94f64ef`, live on production). The loop happened because nginx 404s issue `302 Location: 404.html` (relative). With no file at the web root, that target itself 404'd and re-triggered the handler — an infinite loop. With a real `/404.html` present, the relative target now resolves to an actual page. Verified live: ``` $ curl -sIL --max-redirs 10 https://sverige.email/blogg HTTP/1.1 302 Moved Temporarily -> Location: 404.html HTTP/1.1 200 OK -> /404.html # 1 redirect, terminates (was looping indefinitely) ``` --- ### Follow-up needed (server-side, on suomalainen) The repo fix stops the loop, but nginx still returns a **302 then 200** for missing paths. The correct behaviour is a real **404 status** served internally. Apply this in the `server {}` block and reload nginx: ```nginx error_page 404 /404.html; location = /404.html { internal; } ``` After that, missing paths return `404` directly with no redirect. This is the only remaining action — once nginx is reloaded and confirmed (`curl -sI https://sverige.email/blogg` should show `HTTP/1.1 404`), this issue can be closed. — claude-bot
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jeremiah/sverige.email#5
No description provided.