nginx-ssl.j2 938 B

12345678910111213141516171819202122232425
  1. server {
  2. listen 80;
  3. return 301 https://$host$request_uri;
  4. }
  5. server {
  6. listen 443 ssl;
  7. server_name {{ inventory_hostname }}.api.joystreamstats.live;
  8. location / {
  9. rewrite /$ /api/ last;
  10. proxy_pass http://localhost:3500;
  11. }
  12. location /endpoint {
  13. proxy_pass http://localhost:9944;
  14. proxy_http_version 1.1;
  15. proxy_set_header Upgrade $http_upgrade;
  16. proxy_set_header Connection "Upgrade";
  17. proxy_set_header Host $host;
  18. proxy_set_header X-Real-IP $remote_addr;
  19. }
  20. ssl_certificate /etc/letsencrypt/live/{{ inventory_hostname }}.api.joystreamstats.live/fullchain.pem; # managed by Certbot
  21. ssl_certificate_key /etc/letsencrypt/live/{{ inventory_hostname }}.api.joystreamstats.live/privkey.pem; # managed by Certbot
  22. include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  23. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  24. }