Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit bb4d6143 authored by 65160206's avatar 65160206
Browse files

nginx refresh page not 404

parent 3b6ab950
No related branches found
No related tags found
No related merge requests found
Pipeline #669 failed
......@@ -16,6 +16,9 @@ RUN npm run build
# 👉 Production stage
FROM nginx:stable-alpine
COPY default.conf /etc/nginx/conf.d/default.conf
# ❗ถ้าอยากใช้ custom nginx.conf (optional)
# COPY nginx.conf /etc/nginx/nginx.conf
# คัดลอกไฟล์ที่ build แล้ว ไปยัง nginx
COPY --from=builder /app/dist /usr/share/nginx/html
......
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
\ No newline at end of file
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf; # 🔥 load default.conf จาก conf.d
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment