server { server_name {{ server_name }}; listen 80; listen [::]:80; location / { return https://$server_name$request_uri; } } server { server_name {{ server_name }}; listen 443 ssl http2; listen [::]:443 ssl http2; ssl_trusted_certificate /etc/letsencrypt/live/{{ server_name }}/chain.pem; ssl_certificate /etc/letsencrypt/live/{{ server_name }}/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/{{ server_name }}/privkey.pem; ssl_stapling on; ssl_stapling_verify on; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; location / { proxy_pass http://127.0.0.1:{{ port }}; } }