Nginx-proxy-manager SSL / Nextcloud Desktop login problem?

Greeting,

I am trying to set up a nextcloud server for home use. The nextcloud server is sitting behind the NGINX Proxy Manager reverse proxy, where both are running as docker images.

I am also using duckdns sub-domain. After the initial setup, I can reach my nextcloud server using the duckdns sub-domain using a web browser, but I cannot reach it using nextcloud desktop client in Windows 10. I seek your help.

Basically I follow this youtube (https://www.youtube.com/watch?v=3AYl_o8H450&ab_channel=Steve'sTechStuff) video, and the following docker-compose to create a docker stack:

version: ‘3.3’
services:
nextcloud:
image: nextcloud:latest
container_name: nextcloud
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
volumes:
- PATH/nextcloud/config:/config
- PATH/nextcloud/data:/data
depends_on:
- mariadb
restart: unless-stopped
mariadb:
image: linuxserver/mariadb
container_name: mariadb
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD=NEXTCLOUDDBPASSWORD
- TZ=America/New_York
volumes:
- PATH/mariadb/config:/config
restart: unless-stopped
nginx-proxy-manager:
container_name: nginx-proxy-manager
ports:
- ‘81:8181’
- ‘80:8080’
- ‘443:4443’
volumes:
- ‘PATH/nginx-proxy-manager:/config’
restart: unless-stopped
image: jlesage/nginx-proxy-manager

After the docker stack was created, I configured the Nginx Proxy Manager with SSL certificate/duckdns, and set up a proxy host that points to my nextcloud docker server (port 80). Then, using a web browser, I can enter my duckdns.org sub-domain and reach my nextcloud server.

However, when I tried to set up the nextcloud client on my windows-10 desktop, I get the following error message during the setup process. After entering my URL (the duckdns subdomain) I get:

The polling URL does not start with HTTPS despite the login URL started with HTTPS. Login will not be possible because this might be a security issue. Please contact your administor.

I also notice that, under Administration->Overview, I have 2 warnings:

There are some warnings regarding your setup.

  • The reverse proxy header configuration is incorrect, or you are accessing Nextcloud from a trusted proxy. If not, this is a security issue and can allow an attacker to spoof their IP address as visible to the Nextcloud. Further information can be found in the documentation :arrow_upper_right:.
  • You are accessing your instance over a secure connection, however your instance is generating insecure URLs. This most likely means that you are behind a reverse proxy and the overwrite config variables are not set correctly. Please read the documentation page about this :arrow_upper_right:.

as I am new to both the nextcloud and the nginx proxy manager, I seek your help. I suspect that in my nginx proxy manager, I would need a custom configuration for the duckdns sub-domain, but I am not certain how.

If someone can point to a direction, it would be really appreciated,

regards,

the docker compose file is messy, you need to add two env to nextcloud container:

  • APACHE_DISABLE_REWRITE_IP=1
  • TRUSTED_PROXIES=x.x.x.x/16

first one is stopping apache rewriting, 2nd is the nginx your proxy manager’s container ip