fix(6): resolve static asset serving and proxy header issues
Fixed issues: 1. Caddy not forwarding X-Forwarded headers to Next.js - Added X-Forwarded-For, X-Forwarded-Proto, X-Forwarded-Host 2. Removed X-Content-Type-Options: nosniff (blocks static assets) 3. Copy static files to standalone build directory - Next.js standalone requires files in .next/standalone/.next/static/ 4. Made script auto-copy static files after build Result: ✓ CSS/JS loading with correct MIME types (text/css, text/javascript) ✓ Frontend fully rendering via HTTPS ✓ All static assets cached and served correctly ✓ Tested working via IP address (192.168.84.131:8919)
This commit is contained in:
@@ -16,12 +16,16 @@ https://:8919 {
|
||||
on_demand
|
||||
}
|
||||
|
||||
|
||||
reverse_proxy localhost:8917 {
|
||||
header_up X-Forwarded-For {remote_host}
|
||||
header_up X-Forwarded-Proto https
|
||||
header_up X-Forwarded-Host {host}
|
||||
}
|
||||
|
||||
header {
|
||||
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
||||
X-XSS-Protection "1; mode=block"
|
||||
X-Frame-Options "SAMEORIGIN"
|
||||
X-Frame-Options "SAMEORIGIN"
|
||||
Referrer-Policy "strict-origin-when-cross-origin"
|
||||
}
|
||||
}
|
||||
@@ -32,7 +36,12 @@ https://:8918 {
|
||||
on_demand
|
||||
}
|
||||
|
||||
|
||||
reverse_proxy localhost:8916 {
|
||||
header_up X-Forwarded-For {remote_host}
|
||||
header_up X-Forwarded-Proto https
|
||||
header_up X-Forwarded-Host {host}
|
||||
}
|
||||
|
||||
header {
|
||||
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user