Skip to content

Commit

Permalink
fix: oauth2 로그인 요청에 대한 nginx 설정
Browse files Browse the repository at this point in the history
- nginx 설정에 oauth2 로그인 요청 부분이 빠져있어 이를 추가함
- frontend로 라우팅해주는 부분도 불필요하여 삭제
  • Loading branch information
JadeKim042386 committed Jul 5, 2024
1 parent f7906b5 commit b525db5
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ upstream backendAlive {
keepalive_timeout 30m;
}

upstream frontend {
server host.docker.internal:5173;
}

server {
server_name localhost;
listen 80;
Expand All @@ -26,7 +22,7 @@ server {
add_header 'Access-Control-Allow-Credentials' 'true';
}

location ~ /(api|imgs) {
location ~ /(api|imgs|oauth2|login) {
# preflight response
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' 'http://localhost:5173';
Expand All @@ -39,6 +35,10 @@ server {
rewrite ^/(.*)$ /$1 break;

proxy_pass http://backend/$1$is_args$args;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Auth-Request-Redirect $scheme://$host$request_uri;
add_header 'Access-Control-Allow-Origin' 'http://localhost:5173' always;
add_header 'Access-Control-Allow-Credentials' 'true';
}
Expand All @@ -53,10 +53,4 @@ server {
add_header 'Access-Control-Allow-Origin' 'http://localhost:5173' always;
add_header 'Access-Control-Allow-Credentials' 'true';
}

location / {
proxy_pass http://frontend;
proxy_set_header Connection '';
proxy_http_version 1.1;
}
}

0 comments on commit b525db5

Please sign in to comment.