From 94c8351994a1165a73a3016ed540834c6d59ab38 Mon Sep 17 00:00:00 2001 From: Irwan Cahyono Date: Fri, 8 Aug 2025 12:53:23 +0700 Subject: [PATCH] nginx --- nginx.conf | 23 +++++++++-------------- nuxt.config.ts | 4 ++++ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/nginx.conf b/nginx.conf index bf3da7a..7b4381c 100644 --- a/nginx.conf +++ b/nginx.conf @@ -3,23 +3,18 @@ server { server_name localhost; root /usr/share/nginx/html; + index index.html; location / { - try_files $uri $uri/ /index.html; - add_header Cache-Control "no-cache"; + try_files $uri $uri/ =404; } - - location /_nuxt/ { - expires 1y; + + location = / { + try_files /index.html =404; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { + expires max; add_header Cache-Control "public"; } - - location ~ /\. { - deny all; - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } } diff --git a/nuxt.config.ts b/nuxt.config.ts index 40f6e37..6b35f50 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,6 +1,7 @@ export default defineNuxtConfig({ app: { baseURL: '/', + buildAssetsDir: '/_nuxt/', head: { title: 'Freekake Admin', titleTemplate: '%s | Freekake Admin', @@ -49,6 +50,9 @@ export default defineNuxtConfig({ }, vite: { + server: { + hmr: false + }, optimizeDeps: { include: ['quill'] }, },