60 lines
1.5 KiB
Plaintext
60 lines
1.5 KiB
Plaintext
upstream mcrates_api {
|
|
server api:41337;
|
|
}
|
|
|
|
upstream mcrates_client {
|
|
server client:8080;
|
|
}
|
|
|
|
# upstream mcrates_ws {
|
|
# server 127.0.0.1:40055;
|
|
# }
|
|
|
|
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
# DEV
|
|
server {
|
|
server_name matescrates.au;
|
|
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_proxied any;
|
|
gzip_comp_level 6;
|
|
gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;
|
|
|
|
location / {
|
|
proxy_pass http://mcrates_client;
|
|
proxy_read_timeout 600s;
|
|
}
|
|
|
|
# location /api/ws {
|
|
# proxy_pass http://mcrates_ws;
|
|
# proxy_http_version 1.1;
|
|
# proxy_set_header Upgrade $http_upgrade;
|
|
# proxy_set_header Connection $connection_upgrade;
|
|
# proxy_read_timeout 600s;
|
|
# }
|
|
|
|
location /api/ {
|
|
# trailing slash means api will receive url WITHOUT /api
|
|
proxy_pass http://mcrates_api/;
|
|
proxy_read_timeout 600s;
|
|
}
|
|
|
|
listen [::]:443 ssl ipv6only=on; # managed by Certbot
|
|
listen 443 ssl; # managed by Certbot
|
|
ssl_certificate /etc/letsencrypt/live/matescrates.au/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/matescrates.au/privkey.pem; # managed by Certbot
|
|
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
}
|
|
|
|
# http -> https
|
|
server {
|
|
server_name matescrates.au;
|
|
return 301 https://$host$request_uri;
|
|
}
|