Files
Reijnst/Docker compose files/caldav-gsync/README.txt
2025-08-09 09:24:29 +02:00

56 lines
1.9 KiB
Plaintext

Add to trusted
1. Open console on container
2. php /var/www/html/occ config:system:set trusted_domains 1 --value=kalender.reijnst.se
where value = the domain that is trusted
Step 1: Set trusted_domains with occ Command
First, you need to make sure your trusted domain is set correctly in Nextcloud:
Run this command to set the trusted domain:
bash
Copy
Edit
php /var/www/html/occ config:system:set trusted_domains 1 --value=kalender.reijnst.se
Replace kalender.reijnst.se with your actual Nextcloud domain.
If you have multiple domains, you can set them incrementally (trusted_domains 2, trusted_domains 3, etc.).
Step 2: Set trusted_proxies with occ Command
Next, you'll set the trusted proxy (the IP address of your reverse proxy — in this case, Caddy):
bash
Copy
Edit
php /var/www/html/occ config:system:set trusted_proxies 1 --value=172.18.0.2
Replace 127.0.0.1 with the IP address of your reverse proxy (if it's not on the same machine as Nextcloud). For example, if your Caddy is running remotely, use the Caddy server's IP.
Step 3: Set Forwarded Headers with occ Command
You also need to tell Nextcloud to accept the forwarded headers. Run:
bash
Copy
Edit
php /var/www/html/occ config:system:set forwarded_for_headers 1 --value=HTTP_X_FORWARDED_FOR
php /var/www/html/occ config:system:set forwarded_for_headers 2 --value=HTTP_X_REAL_IP
This will set the headers that Nextcloud will look for to get the real client IP (when behind a proxy).
Step 4: Verify and Restart
After running the commands:
Check your Nextcloud setup by visiting the URL in a browser.
If everything is configured correctly, the "reverse proxy header configuration" error should be gone.
Restart your Nextcloud (or web server) to ensure the changes are applied.
php /var/www/html/occ config:system:set overwrite.cli.url --value="https://kalender.reijnst.se"
php /var/www/html/occ config:system:set overwriteprotocol --value="https"