diff --git a/Frontend/dockerfile b/Frontend/dockerfile index 902ed91..23c494f 100644 --- a/Frontend/dockerfile +++ b/Frontend/dockerfile @@ -14,6 +14,7 @@ RUN npm run build FROM nginx:alpine # Vite build 결과(dist)를 nginx 정적 경로로 복사 COPY --from=build /app/dist /usr/share/nginx/html +COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf # SPA 라우팅 대응(선택): 아래 nginx 설정을 쓰려면 주석 해제 # COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/Frontend/nginx/default.conf b/Frontend/nginx/default.conf new file mode 100644 index 0000000..17e74f4 --- /dev/null +++ b/Frontend/nginx/default.conf @@ -0,0 +1,19 @@ +server { + listen 80; + server_name _; + + root /usr/share/nginx/html; + index index.html; + + # 정적 파일(assets)은 그대로 제공 + location /assets/ { + try_files $uri =404; + expires 7d; + add_header Cache-Control "public, max-age=604800, immutable"; + } + + # SPA 라우팅: 파일 없으면 index.html로 + location / { + try_files $uri $uri/ /index.html; + } +} \ No newline at end of file diff --git a/Frontend/src/pages/MyPage/MyPageLoggedOut.jsx b/Frontend/src/pages/MyPage/MyPageLoggedOut.jsx index aa30bb2..d829267 100644 --- a/Frontend/src/pages/MyPage/MyPageLoggedOut.jsx +++ b/Frontend/src/pages/MyPage/MyPageLoggedOut.jsx @@ -4,7 +4,7 @@ const MyPageLoggedOut = () => { const handleGithubLogin = () => { // OAuth 시작 url - window.location.href = "//" + window.location.href = "http://solvemeup.com/oauth2/authorization/github" }