Revert the self-hosted deploy fix
Restores the tree to3b16d50, reverting:3c649fcFix blank page on self-hosted deploys The earlier public-route commits were already reverted by0ddbd35anda51ab4a, so this returns the working tree exactly to the state at3b16d50. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
22
nginx.conf
22
nginx.conf
@@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user