server { listen 80; server_name cddn.ixvd.net; rewrite ^/(.*)$ https://cddn-webwinkel.nl permanent; } server { listen 80; server_name cddn-webwinkel.nl; # SSL is managed by certbot, no need for a ssl listen; it will be generated automagically! proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Is-Reverse-Proxy "true"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; client_max_body_size 0; location / { proxy_redirect off; proxy_pass http://cddn-site; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }