From 45527789456dfa1355757c49b691542d50ba58b2 Mon Sep 17 00:00:00 2001 From: ghlim00 Date: Fri, 23 Jan 2026 16:26:57 +0900 Subject: [PATCH] =?UTF-8?q?fix:=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/dockerfile | 1 + Frontend/nginx/default.conf | 19 +++++++++++++++++++ Frontend/src/pages/MyPage/MyPageLoggedOut.jsx | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 Frontend/nginx/default.conf 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" }