-
Notifications
You must be signed in to change notification settings - Fork 0
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
2 changed files
with
62 additions
and
56 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
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,57 +1,63 @@ | ||
upstream backend { | ||
server backend:8000; | ||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name gtd.kro.kr; | ||
return 301 https://gtd.kro.kr$request_uri; | ||
} | ||
|
||
server { | ||
listen 443 ssl; | ||
server_name gtd.kro.kr; | ||
client_max_body_size 10M; | ||
|
||
ssl_certificate /etc/nginx/certificate.pem; # managed by Certbot | ||
ssl_certificate_key /etc/nginx/private.key; # managed by Certbot | ||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | ||
ssl_prefer_server_ciphers on; | ||
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; | ||
|
||
location /.well-known/acme-challenge/ { | ||
allow all; | ||
root /var/www/certbot; | ||
} | ||
|
||
location ~* (service-worker\.js)$ { | ||
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; | ||
expires off; | ||
proxy_no_cache 1; | ||
} | ||
|
||
location /static/ { | ||
alias /backend/static/; | ||
http { | ||
upstream backend { | ||
server backend:8000; | ||
} | ||
|
||
location /api/ { | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto https; | ||
proxy_set_header X-Forwarded-Host $server_name; | ||
proxy_set_header Host $host; | ||
proxy_redirect off; | ||
proxy_connect_timeout 300s; | ||
proxy_read_timeout 600s; | ||
proxy_send_timeout 600s; | ||
proxy_buffer_size 128k; | ||
proxy_buffers 4 256k; | ||
proxy_busy_buffers_size 256k; | ||
proxy_pass http://backend; | ||
server { | ||
listen 80; | ||
server_name gtd.kro.kr; | ||
return 301 https://gtd.kro.kr$request_uri; | ||
} | ||
|
||
location / { | ||
root /var/www/frontend; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
server { | ||
listen 443 ssl; | ||
server_name gtd.kro.kr; | ||
client_max_body_size 10M; | ||
|
||
ssl_certificate /etc/nginx/certificate.pem; # managed by Certbot | ||
ssl_certificate_key /etc/nginx/private.key; # managed by Certbot | ||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | ||
ssl_prefer_server_ciphers on; | ||
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; | ||
|
||
location /.well-known/acme-challenge/ { | ||
allow all; | ||
root /var/www/certbot; | ||
} | ||
|
||
location ~* (service-worker\.js)$ { | ||
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; | ||
expires off; | ||
proxy_no_cache 1; | ||
} | ||
|
||
location /static/ { | ||
alias /backend/static/; | ||
} | ||
|
||
location /api/ { | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto https; | ||
proxy_set_header X-Forwarded-Host $server_name; | ||
proxy_set_header Host $host; | ||
proxy_redirect off; | ||
proxy_connect_timeout 300s; | ||
proxy_read_timeout 600s; | ||
proxy_send_timeout 600s; | ||
proxy_buffer_size 128k; | ||
proxy_buffers 4 256k; | ||
proxy_busy_buffers_size 256k; | ||
proxy_pass http://backend; | ||
} | ||
|
||
location / { | ||
root /var/www/frontend; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} | ||
} |