server { listen 443; server_name #serverNameVar; ssl on; ssl_certificate /etc/letsencrypt/live/#serverNameVar/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/#serverNameVar/privkey.pem; location / { proxy_pass http://172.30.26.1:9000/; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_connect_timeout 300; # Default is HTTP/1, keepalive is only enabled in HTTP/1.1 proxy_http_version 1.1; proxy_set_header Connection ""; chunked_transfer_encoding off; } } server { listen 80; server_name #serverNameVar; location / { return 301 https://#serverNameVar$request_uri; } }