server { listen 80; return 301 https://$host$request_uri; } server { listen 443 ssl; server_name {{ inventory_hostname }}.api.joystreamstats.live; location / { rewrite /$ /api/ last; proxy_pass http://localhost:3500; } location /endpoint { proxy_pass http://localhost:9944; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } ssl_certificate /etc/letsencrypt/live/{{ inventory_hostname }}.api.joystreamstats.live/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/{{ inventory_hostname }}.api.joystreamstats.live/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 }