diff --git a/Dockerfile b/Dockerfile index 0326af0..3c5b436 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/nginx.conf b/nginx.conf index 7ded5cf..219f699 100644 --- a/nginx.conf +++ b/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/... } diff --git a/vite.config.ts b/vite.config.ts index e0e2f43..a382b94 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -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',