Revert the self-hosted deploy fix

Restores the tree to 3b16d50, reverting:

  3c649fc  Fix blank page on self-hosted deploys

The earlier public-route commits were already reverted by 0ddbd35 and a51ab4a,
so this returns the working tree exactly to the state at 3b16d50.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-17 21:01:49 +05:30
parent a51ab4ade8
commit 9a7852c8a2
8 changed files with 15 additions and 155 deletions

View File

@@ -49,29 +49,12 @@ http {
root /usr/share/nginx/html;
index index.html;
# Container liveness for Dokploy/Docker. Kept above the SPA fallback so it
# answers with a real status instead of 200-plus-index.html, which would
# make any health check pass even with the app completely broken.
location = /health {
access_log off;
add_header Content-Type text/plain;
return 200 "ok\n";
}
# Vite writes content-hashed filenames here, so they can be cached forever.
# Only add_header is used — combining it with `expires` emits two
# conflicting Cache-Control headers.
#
# try_files ending in =404 is deliberate: without it a stale index.html
# asking for an asset from a previous deploy would fall through to the
# SPA rule below and receive index.html with a 200 and a text/html type.
# The browser refuses to execute that as a module and the page renders
# empty with only a MIME error in the console — a real 404 is far easier
# to diagnose and lets a reload recover.
location /assets/ {
add_header Cache-Control "public, max-age=31536000, immutable";
access_log off;
try_files $uri =404;
}
# index.html must be revalidated every time or deploys won't take effect
@@ -82,11 +65,6 @@ http {
location / {
# This line forces Nginx to pass routing back to React Router
try_files $uri $uri/ /index.html;
# The fallback is served under the requested path, so the `= /index.html`
# rule above never applies to it. Without this a proxy or browser can
# cache the old HTML and keep loading assets that no longer exist.
add_header Cache-Control "no-cache";
}
}
}