# redirect all traffic to https server { listen 80 ; listen [::]:80 ; server_name alcap.duckdns.org; return 301 https://$host$request_uri; } # main server block server { listen 443 ssl http2; listen [::]:443 ssl http2; index index.html index.htm index.php; server_name alcap.duckdns.org; # all ssl related config moved to ssl.conf include /config/nginx/ssl.conf; client_max_body_size 50; server_tokens off; location / { proxy_pass https://cocalc:443; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 3m; proxy_send_timeout 3m; } }