The Basics
-
Nextcloud Server version: 33.0.2
-
Operating system: Synology DSM 7 (Linux)
-
Web server: Apache (inside Nextcloud Docker container)
-
Reverse proxy: Synology DSM built-in reverse proxy (nginx-based)
-
PHP version: 8.4.20
-
Is this the first time youâve seen this error? No
-
When did this problem first start? From initial setup
-
Installation method: Docker (official Nextcloud image + MariaDB via docker-compose)
-
Are you using Cloudflare, mod_security, or similar? No
Summary of the issue:
Nextcloud is running in Docker on a Synology DS225+ behind the Synology built-in reverse proxy. External HTTPS access works fine in the browser, but Nextcloud does not recognize the HTTPS protocol correctly. This causes:
-
Nextcloud admin panel shows âHTTPS not configuredâ warning
-
DAVxâ” on Android gets HTTP 405 on CalDAV endpoint (workaround: use
/remote.php/davin URL) -
iPhone CalDAV with SSL fails completely
-
Setting
overwriteprotocol = httpscauses ERR_TOO_MANY_REDIRECTS on local access
Steps to replicate:
-
Set
overwriteprotocol = httpsviaocc config:system:set -
Try to access Nextcloud locally via
http://192.168.x.x:8080 -
ERR_TOO_MANY_REDIRECTS occurs
-
Remove
overwriteprotocolâ local access works again but HTTPS warning returns
Configuration
Nextcloud config:list system output:
{
"system": {
"trusted_domains": [
"192.168.x.x:8080",
"yournas.synology.me",
"192.168.x.x"
],
"overwrite.cli.url": "https://yournas.synology.me",
"trusted_proxies": ["172.19.0.0/16", "127.0.0.1"],
"overwritehost": "yournas.synology.me",
"forwarded_for_headers": ["HTTP_X_FORWARDED_FOR"],
"overwritecondaddr": "^172\\.19\\.0\\.[0-9]+$",
"maintenance_window_start": "1",
"default_phone_region": "NL",
"memcache.local": "\\OC\\Memcache\\APCu",
"dbtype": "mysql"
}
}
Synology reverse proxy headers:
X-Forwarded-Proto: https
X-Forwarded-Host: yournas.synology.me
X-Forwarded-Port: 443
Access-Control-Allow-Methods: GET,POST,PUT,DELETE,MKCOL,PROPFIND,PROPPATCH,COPY,MOVE,REPORT,OPTIONS
Reverse proxy rule:
Source: HTTPS yournas.synology.me:443
Destination: HTTP localhost:8080
Docker network:
Subnet: 172.19.0.0/16
Gateway: 172.19.0.1
What Iâve tried:
-
Setting
trusted_proxiesto172.17.0.0/16(wrong subnet), corrected to172.19.0.0/16 -
Setting
overwritecondaddrto match Docker subnet^172\.19\.0\.[0-9]+$â still causes redirect loop -
Adding all X-Forwarded-* headers in Synology reverse proxy
-
Using
/remote.php/davsuffix in DAVxâ” URL â resolves 405 but only without overwriteprotocol
Question:
How do I correctly configure Nextcloud behind the Synology DSM reverse proxy so that:
-
HTTPS is recognized correctly by Nextcloud (no âHTTPS not configuredâ warning)
-
Local HTTP access still works without redirect loop
-
CalDAV works for both DAVxâ” (Android) and iPhone via SSL
-
overwriteprotocol = httpscan be set without causing redirect loops
Any help is greatly appreciated!