-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
37 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,47 @@ | ||
worker_processes 1; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
sendfile on; | ||
keepalive_timeout 65; | ||
|
||
server { | ||
listen 80; | ||
server_name floating.site www.floating.site; | ||
server { | ||
listen 80; | ||
floating.site www.floating.site; | ||
charset utf-8; | ||
server_tokens off; | ||
client_max_body_size 1G; | ||
|
||
location / { | ||
return 301 https://$host$request_uri; | ||
} | ||
|
||
# HTTP -> HTTPS 리다이렉트 | ||
location / { | ||
return 301 https://$host$request_uri; | ||
} | ||
location /.well-known/acme-challenge/ { | ||
allow all; | ||
root /var/www/certbot; | ||
} | ||
|
||
server { | ||
listen 443 ssl; | ||
server_name floating.site www.floating.site; | ||
} | ||
|
||
server { | ||
listen 443 ssl; | ||
server_name floating.site www.floating.site; | ||
|
||
ssl_certificate /etc/ssl/certs/fullchain.pem; | ||
ssl_certificate_key /etc/ssl/private/privkey.pem; | ||
ssl_certificate /etc/ssl/certs/fullchain.pem; | ||
ssl_certificate_key /etc/ssl/private/privkey.pem; | ||
|
||
ssl_protocols TLSv1.2 TLSv1.3; | ||
ssl_ciphers HIGH:!aNULL:!MD5; | ||
ssl_protocols TLSv1.2 TLSv1.3; | ||
ssl_ciphers HIGH:!aNULL:!MD5; | ||
|
||
# 정적 파일 서빙 | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
# API 요청은 백엔드로 전달 | ||
location /api/ { | ||
proxy_pass http://backend:8080; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
# API 요청은 백엔드로 전달 | ||
location /api/ { | ||
proxy_pass http://backend:8080; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
location /login/ { | ||
proxy_pass http://backend:8080; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
location /oauth2/ { | ||
proxy_pass http://backend:8080; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
# 정적 파일 서빙 | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} | ||
|
||
} |