diff --git a/Dockerfile b/Dockerfile index 466f520..3732bd8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,6 @@ RUN npm install --legacy-peer-deps COPY . . -ENV NUXT_SSR=false RUN npm run build # Dockerfile untuk server Nuxt 3 diff --git a/nginx.conf b/nginx.conf index 99fa85a..bf0987a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -9,12 +9,16 @@ server { try_files $uri $uri/ /index.html; } - location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { - expires 7d; - access_log off; + location /_nuxt/ { + expires 1y; add_header Cache-Control "public"; } + location = /index.html { + expires -1; + add_header Cache-Control "no-store"; + } + location ~ /\. { deny all; } diff --git a/nuxt.config.ts b/nuxt.config.ts index aa0bc0c..40f6e37 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -73,13 +73,13 @@ export default defineNuxtConfig({ }, ssr: false, - nitro: { - preset: 'static', // Generate file static - prerender: { - failOnError: false, // Skip error saat generate - ignore: ['/dynamic-route'], // Ignore route tertentu - crawlLinks: false // Nonaktifkan crawler - } - }, +// nitro: { +// preset: 'static', // Generate file static +// prerender: { +// failOnError: false, // Skip error saat generate +// ignore: ['/dynamic-route'], // Ignore route tertentu +// crawlLinks: false // Nonaktifkan crawler +// } +// }, }); \ No newline at end of file