Skip to content

Commit 7e237ed

Browse files
committed
[CICD] nginx.conf 추가
1 parent a2d95ae commit 7e237ed

7 files changed

Lines changed: 104 additions & 15 deletions

File tree

350 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

.idea/gradle.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 68 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nginx.conf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
server {
2+
listen 443 ssl;
3+
server_name api.fitfit.site;
4+
5+
# SSL 인증서 경로도 api.fitfit.site에 맞게 새로 발급
6+
# (예: sudo certbot --nginx -d api.fitfit.site)
7+
ssl_certificate /etc/letsencrypt/live/api.fitfit.site/fullchain.pem;
8+
ssl_certificate_key /etc/letsencrypt/live/api.fitfit.site/privkey.pem;
9+
include /etc/letsencrypt/options-ssl-nginx.conf;
10+
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
11+
12+
location / {
13+
# 요청을 내부 스프링 앱(8080 포트)으로 전달하는 것은 동일합니다.
14+
proxy_pass http://127.0.0.1:8080;
15+
proxy_set_header Host $host;
16+
proxy_set_header X-Real-IP $remote_addr;
17+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
18+
proxy_set_header X-Forwarded-Proto $scheme;
19+
}
20+
}
21+
22+
server {
23+
listen 80;
24+
server_name api.fitfit.site;
25+
return 301 https://$host$request_uri;
26+
}

src/main/java/fitfit/global/config/WebConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class WebConfig implements WebMvcConfigurer {
1010
@Override
1111
public void addCorsMappings(CorsRegistry registry) {
1212
registry.addMapping("/**") // 모든 경로에 대해
13-
.allowedOrigins("https://d2nzr3y6e8k3zl.cloudfront.net/", "http://localhost:3000", "https://algogaza.site/") // CloudFront와 로컬 개발 환경 허용
13+
.allowedOrigins("https://d3trbid3w75opm.cloudfront.net/", "http://localhost:3000", "https://fitfit.site/", "http://localhost:5173") // CloudFront와 로컬 개발 환경 허용
1414
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
1515
.allowedHeaders("*")
1616
.allowCredentials(true)

0 commit comments

Comments
 (0)