....
This commit is contained in:
@@ -9,7 +9,7 @@ RUN npm run build
|
||||
# 2단계: 실행 (Nginx)
|
||||
FROM nginx:stable-alpine
|
||||
# 빌드된 파일들을 Nginx의 기본 경로로 복사
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
COPY --from=build /app/dist /usr/share/nginx/html/ftp
|
||||
# (선택) 커스텀 nginx 설정을 넣고 싶다면 아래 주석 해제
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
|
||||
11
nginx.conf
11
nginx.conf
@@ -11,12 +11,11 @@ server {
|
||||
gzip_proxied expired no-cache no-store private auth;
|
||||
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
location /ftp/ {
|
||||
alias /usr/share/nginx/html/ftp/;
|
||||
try_files $uri $uri/ /ftp/index.html;
|
||||
}
|
||||
|
||||
# Handle assets correctly to avoid fallback to index.html for missing files
|
||||
location /assets/ {
|
||||
try_files $uri =404;
|
||||
}
|
||||
# Handle assets explicitly if needed, but the above generic rule covers it if files exist
|
||||
# If the user requests /ftp/assets/..., the alias maps it to /usr/share/nginx/html/ftp/assets/...
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import react from '@vitejs/plugin-react';
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, '.', '');
|
||||
return {
|
||||
base: './',
|
||||
base: '/ftp/',
|
||||
server: {
|
||||
port: 3000,
|
||||
host: '0.0.0.0',
|
||||
|
||||
Reference in New Issue
Block a user