The issue
Hi, everyone!
Yesterday, I installed Nextcloud within a docker container alongside with Nginx Proxy Manager to obtain secure HTTPS with two domains: one localand another to use with Tailscale.
While Nextcloud appears to be working in general, when I try to login in the Nextcloud Client for Linux (in this case: Lubuntu 25.10) I recieve this error message:
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 administrator.
Since the first time I saw this error I went trough post about this kind of issue on Nextcloud Forum and Reddit, for example. I did some things like the modification of config.php file to accommodate some variables like trusted_domains, overwritemethod and overwrite.cli.url and the implementation of custom configuration in the Nginx proxies for Nextcloud. But still, THE CLIENT LOGIN STILL DOESN’T WORK!!!
I thank you in advance to anyone who may try to help me to solve this. I provided some information that I think that will be useful to solve this issue and feel free to request more if needed.
Server Information
- Nextcloud Server version:
33.0.1.2
- Operating system and version:
Ubuntu 24.04.4
- Reverse proxy and version:
Nginx 2.14.0
- PHP version:
8.4.19- EDIT: I just noticed that originally I put the Nextcloud version instead the PHP one…
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
Docker Compose
- Are you using CloudfIare, mod_security, or similar? (Yes / No)
No
Nextcloud config.php
<?php
$CONFIG = array (
'htaccess.RewriteBase' => '/',
'memcache.local' => '\\OC\\Memcache\\APCu',
'apps_paths' =>
array (
0 =>
array (
'path' => '/var/www/html/apps',
'url' => '/apps',
'writable' => false,
),
1 =>
array (
'path' => '/var/www/html/custom_apps',
'url' => '/custom_apps',
'writable' => true,
),
),
'upgrade.disable-web' => true,
'instanceid' => 'oclqwx7d5em5',
'passwordsalt' => 'PLoUip5V+0zRxE9syBcmLA+r+W0vvQ',
'secret' => '*secret sfuff*',
'trusted_domains' =>
array (
0 => '*tailscale duckdns domain*', # To access through Tailscale
1 => '*local duckdns domain*', # To access locally
),
'datadirectory' => '/var/www/html/data',
'dbtype' => 'mysql',
'version' => '33.0.1.2',
'trusted_proxies' =>
array (
0 => '127.0.0.1:80', # Nginx proxy for HTTP
1 => '127.0.0.1:443', # Nginx proxy to HTTPS
),
'overwrite.cli.url' => 'http://*tailscale duckdns domain*',
'overwritemethod' => 'https',
'dbname' => '*database name*',
'dbhost' => 'db',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => '*database username*',
'dbpassword' => '*database password*',
'installed' => true,
'loglevel' => 0,
);
Nginx Custom Configuration
location /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
location ^~ /.well-known {
return 301 $scheme://$host/index.php$uri;
}
Docker Compose
Nextcloud
services:
# Note: MariaDB is external service. You can find more information about the configuration here:
# https://hub.docker.com/_/mariadb
db:
# Note: Check the recommend version here: https://docs.nextcloud.com/server/latest/admin_manual/installation/system_requirements.html#server
image: mariadb:lts
container_name: nextcloud-compose-db
restart: always
command: --transaction-isolation=READ-COMMITTED
volumes:
- /home/*linux username*/nextcloud/db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=*database root password*
- MYSQL_PASSWORD=*database password*
- MYSQL_DATABASE=*database name*
- MYSQL_USER=*database username*
# Note: Redis is an external service. You can find more information about the configuration here:
# https://hub.docker.com/_/redis
redis:
image: redis:alpine
restart: always
app:
image: nextcloud
container_name: nextcloud-compose
restart: always
ports:
- 8080:80
depends_on:
- redis
- db
volumes:
- /home/franciscogameiro2004/nextcloud/nextcloud:/var/www/html
environment:
- MYSQL_PASSWORD=*database password*
- MYSQL_DATABASE=*database name*
- MYSQL_USER=*database username*
- MYSQL_HOST=db
#
- NEXTCLOUD_TRUSTED_DOMAINS=*local duckdns domain*,*tailscale duckdns domain*
- NEXTCLOUD_DEFAULT_PHONE_REGION=PT
Nginx Proxy Manager
services:
nginx_proxy_manager:
image: "jc21/nginx-proxy-manager:latest"
container_name: nginx_proxy_manager
restart: unless-stopped
network_mode: "host"
ports:
- "80:80" # HTTP
- "443:443" # HTTPS
- "81:81" # Admin Panel
volumes:
- ./data/npm_data:/data
- ./data/npm_letsencrypt:/etc/letsencrypt
- ./data/npm_logs:/var/log/nginx
environment:
DB_SQLITE_FILE: "/data/database.sqlite" # Using SQLite instead of MySQL for simplicity
INITIAL_ADMIN_EMAIL: admin@example.com
INITIAL_ADMIN_PASSWORD: changeme
X_FORWARDED_PROTO: "https"