Fix maintenance /assets 403 and remove vite-plugin-pwa
- nginx try_files: remove $uri/ so the Vite assets/ build directory doesn't shadow the /assets React route and trigger a 403 - Remove VitePWA plugin (leftover from scaffold, not needed for internal app) - Strip PWA-specific nginx location blocks (manifest, sw.js, registerSW.js) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c43a23b00d
commit
a3b458abca
3 changed files with 3 additions and 44 deletions
|
|
@ -1,20 +1,4 @@
|
||||||
server {
|
server {
|
||||||
location = /maintenance/manifest.webmanifest {
|
|
||||||
default_type application/manifest+json;
|
|
||||||
add_header Cache-Control "no-cache";
|
|
||||||
try_files $uri =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
location = /maintenance/sw.js {
|
|
||||||
add_header Cache-Control "no-cache";
|
|
||||||
try_files $uri =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
location = /maintenance/registerSW.js {
|
|
||||||
add_header Cache-Control "no-cache";
|
|
||||||
try_files $uri =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
|
|
@ -47,7 +31,7 @@ server {
|
||||||
|
|
||||||
location /maintenance/ {
|
location /maintenance/ {
|
||||||
add_header Cache-Control "no-cache" always;
|
add_header Cache-Control "no-cache" always;
|
||||||
try_files $uri $uri/ /maintenance/index.html;
|
try_files $uri /maintenance/index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = / {
|
location = / {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@
|
||||||
"@types/react-dom": "^18.3.1",
|
"@types/react-dom": "^18.3.1",
|
||||||
"@vitejs/plugin-react": "^4.3.4",
|
"@vitejs/plugin-react": "^4.3.4",
|
||||||
"typescript": "^5.7.2",
|
"typescript": "^5.7.2",
|
||||||
"vite": "^6.0.5",
|
"vite": "^6.0.5"
|
||||||
"vite-plugin-pwa": "^1.3.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,7 @@
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import react from '@vitejs/plugin-react'
|
import react from '@vitejs/plugin-react'
|
||||||
import { VitePWA } from 'vite-plugin-pwa'
|
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
base: '/maintenance/',
|
base: '/maintenance/',
|
||||||
plugins: [
|
plugins: [react()],
|
||||||
react(),
|
|
||||||
VitePWA({
|
|
||||||
registerType: 'autoUpdate',
|
|
||||||
manifest: {
|
|
||||||
name: 'Maintenance',
|
|
||||||
short_name: 'Maint.',
|
|
||||||
start_url: '/maintenance/',
|
|
||||||
scope: '/maintenance/',
|
|
||||||
display: 'standalone',
|
|
||||||
theme_color: '#b45309',
|
|
||||||
background_color: '#b45309',
|
|
||||||
icons: [
|
|
||||||
{ src: '/maintenance/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
|
|
||||||
{ src: '/maintenance/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
workbox: {
|
|
||||||
navigateFallback: '/maintenance/index.html',
|
|
||||||
navigateFallbackDenylist: [/\/api\//],
|
|
||||||
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue