Nextcloud behind apache reverse proxy; Webdav problem

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version :16.0.1
Operating system and version: Ubuntu server 18.04
Apache or nginx version: 2.4.29
PHP version: 7.2

The issue you are facing:
I have two identical virtual systems. One with nextcloud installed and the other one is an apache reverse proxy. On the nextcloud system under Settings->Overview->Security & setup warnings there are no problems. But when I access it through the apache reverse proxy then it tells me:

“Your web server is not properly set up to resolve “/.well-known/caldav”. Further information can be found in the [documentation]
Your web server is not properly set up to resolve “/.well-known/carddav”. Further information can be found in the [documentation]”

Reverse proxy config:

#       Redirect 301 /.well-known/carddav http://192.168.178.13/cloud/remote.php/dav
#       Redirect 301 /.well-known/caldav http://192.168.178.13/cloud/remote.php/dav
#       <Location /.well-known/carddav>
#            ProxyPass http://192.168.178.13/cloud/remote.php/dav
#            ProxyPassReverse http://192.168.178.13/cloud/remote.php/dav
#       </Location>

        <Location /cloud>
            ProxyPass http://192.168.178.13/cloud
            ProxyPassReverse http://192.168.178.13/cloud
#           RewriteEngine On
#           RewriteRule ^/\.well-known/carddav https://%{192.168.178.13}/remote.php/dav/ [R=301,L]
#           RewriteRule ^/\.well-known/caldav https://%{192.168.178.13}/remote.php/dav/ [R=301,L]
            Redirect 301 /.well-known/carddav /remote.php/dav
            Redirect 301 /.well-known/caldav /remote.php/dav
#           ProxyPassReverseCookiePath /cloud /cloud
        </Location>

Everything except the webdav part works. I tried redirecting it inside the location. I tried it outside the location. I tried it with own locations. Nothing worked :frowning:

I am relativly new to apache and a bit lost…
I did not find anything about running nextcloud behind a proxy in the documentation and google didn’t help me either.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Install Nextcloud on one system
  2. Install a reverse proxy on a second system
  3. Access the nextcloud instance through the proxy

The output of your Nextcloud log in Admin > Logging:

No entries for the last 3 days. Problem occured after last entry.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => '192.168.178.13',
    1 => '192.168.178.14',
  ),
  'trusted_proxies' => ['192.168.178.14'],
  'datadirectory' => '/var/www/html/cloud/data',
  'dbtype' => 'pgsql',
  'version' => '16.0.1.1',
  'overwrite.cli.url' => 'http://192.168.178.13/cloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextclouduser',
  'dbpassword' => 'nextcloud',
  'installed' => true,
  'memcache.local' => '\OC\Memcache\APCu',
  'overwritehost' => '192.168.178.13',
);

The output of your Apache/nginx/system log in /var/log/____:

No entries for the last 3 days. Problem occured after last entry.

I am thankful for any help. :slight_smile: