Error "HTTPS required" when using extension behind Apache Proxy

I have nextcloud installed behind a Apache proxy in a docker container. The Apache self delivers files using HTTPS (letsencrypt certificate). The communication between Apache and the Docker container is not HTTPS secured.

The docker-container’s apache port (where nextcloud runs) is emitting the port 1234.

Is it possible to run run the password app with this configuration?

<VirtualHost *:443>
    [...]
    ProxyPass / http://localhost:1234/ retry=1
    ProxyPassReverse / http://localhost:1234/
    ProxyPreserveHost On
    ProxyVia On
    RequestHeader set X-Forwarded-Proto 'https' env=HTTPS
    Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"
    [...]
</VirtualHost>

The warning message created by the app includes a link to the documentation for setting up trusted reverse proxies in Nextcloud. Follow the documentation and the warning should disappear.

1 Like

Ok, it works now. I tried it before, but was missing some entries. Now it works with this config:

‘trusted_proxies’ => [‘172.17.0.1’],
‘overwritehost’ => ‘cloud.mydomain.com’,
‘overwriteprotocol’ => ‘https’,