Skip to content

Commit

Permalink
Merge pull request #84 from wafflestudio/develop
Browse files Browse the repository at this point in the history
Cors Issue, nginx files
  • Loading branch information
yeonsumia authored Apr 5, 2022
2 parents 0f3a063 + 9a11892 commit 42ea1b6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
33 changes: 33 additions & 0 deletions nginx/conf.d/app.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
server {
listen 80;
server_name api-feelin.kro.kr;
server_tokens off;

location / {
return 301 https://$host$request_uri;
}

location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
}

server {
listen 443 ssl;
server_name api-feelin.kro.kr;
ssl_certificate /etc/letsencrypt/live/api-feelin.kro.kr/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/api-feelin.kro.kr/privkey.pem;

include /etc/nginx/conf.d/service_url.inc;

location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_pass $service_url;
proxy_redirect off;
}
}
1 change: 1 addition & 0 deletions nginx/conf.d/service_url.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set $service_url http://13.209.87.220:8080;
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class SecurityConfig(

override fun configure(http: HttpSecurity) {
http
.cors().configurationSource(corsConfigurationSource())
.and()
.csrf().disable()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
Expand Down

0 comments on commit 42ea1b6

Please sign in to comment.