29 lines
862 B
Nginx Configuration File
29 lines
862 B
Nginx Configuration File
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name achievements.ajb.dk;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/git.ajb.dk/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/git.ajb.dk/privkey.pem; # managed by Certbot
|
|
|
|
# Backend
|
|
location /api {
|
|
proxy_pass http://localhost:4000;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "Upgrade";
|
|
proxy_set_header Host $host;
|
|
|
|
# Prevent websocket connections timing out after 1 minute.
|
|
# This sets the timeout to 24 hours:
|
|
proxy_read_timeout 86400;
|
|
proxy_send_timeout 86400;
|
|
}
|
|
|
|
# Frontend (serve yew app static files)
|
|
location / {
|
|
alias /var/www/achievements/;
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|