This commit is contained in:
Irwan Cahyono 2025-08-08 13:57:24 +07:00
parent 01a1bae275
commit 8a79a37d29
4 changed files with 17 additions and 17 deletions

View File

@ -8,7 +8,7 @@ RUN npm install --legacy-peer-deps
COPY . . COPY . .
RUN npm run build RUN npm run generate
# Dockerfile untuk server Nuxt 3 # Dockerfile untuk server Nuxt 3
FROM nginx:1.29-alpine FROM nginx:1.29-alpine

View File

@ -2,20 +2,25 @@ server {
listen 80; listen 80;
server_name localhost; server_name localhost;
root /var/www/html;
index index.html;
location / { location / {
root /var/www/html;
index index.html;
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
location /_nuxt/ { location /_nuxt/ {
alias /var/www/html/_nuxt/;
expires 1y; expires 1y;
add_header Cache-Control "public"; add_header Cache-Control "public";
} }
location = /index.html { location ~ /\. {
expires -1; deny all;
add_header Cache-Control "no-store"; }
error_page 404 /index.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
} }
} }

View File

@ -76,14 +76,10 @@ export default defineNuxtConfig({
}, },
}, },
ssr: false, ssr: false,
// nitro: { target: 'static',
// preset: 'static', // Generate file static generate: {
// prerender: { dir: '.output/public',
// failOnError: false, // Skip error saat generate }
// ignore: ['/dynamic-route'], // Ignore route tertentu
// crawlLinks: false // Nonaktifkan crawler
// }
// },
}); });

1
package-lock.json generated
View File

@ -3515,7 +3515,6 @@
}, },
"node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": { "node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": {
"version": "1.1.0", "version": "1.1.0",
"dev": true,
"inBundle": true, "inBundle": true,
"license": "MIT" "license": "MIT"
}, },