Update to swag reverse proxy config sample for nextcloud

I was going though the motions of setting up and configuring a swag container to act as a reverse proxy for my local nextcloud instance.

While reading the official documentation I noticed that there is something missing from nextcloud.subdomain.conf.sample that may be important.

Copying from the documentation page:

The redirects for CalDAV or CardDAV does not work if Nextcloud is running behind a reverse proxy.
The recommended solution is that your reverse proxy does the redirects.

And they suggest adding something like:

location /.well-known/carddav {
    return 301 $scheme://$host/remote.php/dav;
}

location /.well-known/caldav {
    return 301 $scheme://$host/remote.php/dav;
}

or something like:

rewrite ^/\.well-known/carddav https://$server_name/remote.php/dav/ redirect;
rewrite ^/\.well-known/caldav https://$server_name/remote.php/dav/ redirect;

Do you think that those redirects should be added to the sample configs?

I 've added them to my proxy config although I wasn’t sure how to test if they are needed. I 'll need some time to look it up.

I am using the swag+nextcloud subdomain conf file without any issues with caldav or cardav since a couple of weeks. So at least for my Nextcloud instance with two users that share calendars etc it works without these rewrite rules.

2 Likes

Good to know, thanks

Here is my docker-compose file if you are interested.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.