I am having trouble accessing the Nextcloud carddav service via my reverse proxy server. This may be why my Maps app does not work as it should. It is not placing contacts on the map.
The following produces a sane response: curl --user “Fred:Barney” -s -X GET -i https://cloud.flintstone.nz/remote.php/dav/addressbooks/users/fred/persons/55EFE43F-3770-4A77-91CC-CB1E3DCBCF8A.vcf
This indicates (to me) that the service does work when the request is sent to the right place. I have created a rewrite rule on the proxy in vhost:
RewriteEngine On
RewriteCond %{HTTP_HOST} =cloud.flintstone.nz
RewriteRule ^.well-known/carddav/(.*)$ https://private IP of cloud server/remote.php/dav/$1 [L,P]
When the same request is made but to https://cloud.flintstone.nz/.well-known/carddav/ etc I get
‘The Document has moved’
Also, strangely, the ‘Location’ is: https://cloud.flintstone.nz/ /remote.php/dav
The double backslash is wrong (it seems to me).
Perhaps there has been a redirect and I need a ProxyPassReverse? Or am I completely barking up the wrong tree?
I’m using Nextcloud Hub 3 (25.0.2); Apache 2.4.55; PHP 8.0.27 on Proxy, 7.4.33 on the Nextcloud server; Contacts 5.0.3 My Nextcloud instance is in the Ubuntu default root /var/www/html/. It is in a folder called nextcloud so the path is /var/www/html/nextcloud. Relevant parts of Nextcloud vhost file are:
DocumentRoot /var/www/html/nextcloud/
ServerName private IP of server
<Directory /var/www/html/nextcloud/>
Require all granted
Options FollowSymLinks MultiViews
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
Satisfy Any
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
</IfModule>
</Directory>
I don't see why .htaccess in the document root doesn't do the job. I see from the manual that there are problems working behind a reverse proxy but some information why this is would be useful