Fix Vite allowedHosts blocking production domains
Set allowedHosts to true since nginx handles Host header
validation. The previous `.${domain}` pattern used the
build-time DOMAIN value, which breaks when the same image
is deployed to a different domain.
Bunker Admin
This commit is contained in:
parent
cbfa4f9e28
commit
d17e197a1b
@ -15,12 +15,11 @@ export default defineConfig({
|
|||||||
server: {
|
server: {
|
||||||
port: 3000,
|
port: 3000,
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
allowedHosts: [
|
// Allow all hosts — nginx handles Host header validation in production.
|
||||||
`.${domain}`, // Allow all subdomains of configured domain
|
// Vite's allowedHosts only sees the build-time DOMAIN value, which may
|
||||||
'changemaker-v2-admin', // Allow container hostname
|
// differ from the runtime domain (e.g., image built for cmlite.org but
|
||||||
'localhost',
|
// deployed to wokemail.org).
|
||||||
'127.0.0.1',
|
allowedHosts: true,
|
||||||
],
|
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
// Use env var with fallback: Docker uses container name, local uses localhost
|
// Use env var with fallback: Docker uses container name, local uses localhost
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user