Plain HTTP request was sent to HTTPS port


So I am trying to set up the Nextcloud AIO VM behind an Nginx reverse proxy. It all seems to work just fine, until it wants me to type in the Domain that the Nextcloud should be available under. When doing that it just gives an error that the Domain is supposedly wrong (even tho I am accessing the site asking me this through that Domain). Looking into the log reveals it’s for some reason trying to access http://<my domain>:443 to which my webserver obviously replies Bad Request - Plain HTTP request was sent to HTTPS port.

Here is my Nginx config:

server {
        listen 80;
        listen [::]:80;

        location / {
               proxy_set_header Host $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_buffering off;
               proxy_ssl_verify off;

        ... certbot generated HTTPS config here, nothing special

Any ideas?


Hi, the AIO VM is not meant to be used behind a reverse proxy.

See all-in-one/ at main · nextcloud/all-in-one · GitHub if you want to do so.