1
0

nginx-ssl.j2 893 B

123456789101112131415161718192021222324252627
  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. proxy_pass http://localhost:3500/api;
  10. }
  11. location /api {
  12. proxy_pass http://localhost:3500;
  13. }
  14. location /endpoint {
  15. proxy_pass http://localhost:9944;
  16. proxy_http_version 1.1;
  17. proxy_set_header Upgrade $http_upgrade;
  18. proxy_set_header Connection "Upgrade";
  19. proxy_set_header Host $host;
  20. proxy_set_header X-Real-IP $remote_addr;
  21. }
  22. ssl_certificate /etc/letsencrypt/live/$host/fullchain.pem; # managed by Certbot
  23. ssl_certificate_key /etc/letsencrypt/live/$host/privkey.pem; # managed by Certbot
  24. include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  25. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  26. }