Skip to content

Commit

Permalink
[FIX] Nginx 프록시 서버 설정 변경
Browse files Browse the repository at this point in the history
Nginx 설정을 수정하여 HTTPS로 연결된 서버에서 포트 8080에 위치한 백엔드 서버로 요청을 프록시하도록 변경

Fixes: TICO-215
Related to: TICO-209, TICO-161
  • Loading branch information
bu119 committed Jul 12, 2024
1 parent 09dd6de commit b4ea659
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ public class SecurityConfig {

private static final String[] swaggerURL = {
"/graphiql", "/graphql",
"/swagger-ui/**", "/swagger-ui.html",
"/v3/api-docs/**", "/api-docs/**",
"/swagger-ui/index.html/**",
"/swagger-resources/**", "/swagger-ui/**", "/v3/api-docs", "/api-docs/**"
"/swagger-ui.html", "/swagger-ui/**", "/v3/api-docs/**", "/swagger-resources/**"
};

// 스프링 시큐리티 기능 비활성화 ('인증','인가' 서비스 적용x)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Tag(name = "root", description = "애플리케이션 기본 정보 API")
@Tag(name = "Root", description = "애플리케이션 기본 정보 API")
@RestController
@RequiredArgsConstructor
@RequestMapping("/")
Expand Down
9 changes: 7 additions & 2 deletions nginx/conf/conf.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ server {
ssl_certificate_key /etc/letsencrypt/live/pomorodo.shop/privkey.pem;

# 원하는 서비스를 제공하는 2차 라우팅
location /api {
proxy_pass http://pomorodo.shop:8080/api;
location / {
proxy_pass http://pomorodo.shop:8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

# /api 경로 프록시 설정
location /api {
proxy_pass http://localhost:8080/api;
}
}
}

0 comments on commit b4ea659

Please sign in to comment.