Nginx, reverse proxy and webfinger - what is the ideal configuration

Hi,

I have Nextcloud running on a docker container (not the official one, just one I made with Ubuntu and nginx). I also use nginx as reverse proxy.
I keep getting the (in)famous complaint from Nextcloud:

  • Your web server is not properly set up to resolve “/.well-known/webfinger”. Further information can be found in the documentation :arrow_upper_right:.
  • Your web server is not properly set up to resolve “/.well-known/nodeinfo”. Further information can be found in the documentation :arrow_upper_right:.

On my NGINX proxy I have this configured on my nextcloud.conf:

location /.well-known/webfinger {
    return 301 $scheme://$host/index.php/.well-known/webfinger;
}

On my nginx behind the proxy, I have:

location ^~ /.well-known {
        # The rules in this block are an adaptation of the rules
        # in `.htaccess` that concern `/.well-known`.

        location = /.well-known/carddav { return 301 /remote.php/dav/; }
        location = /.well-known/caldav  { return 301 /remote.php/dav/; }

        location /.well-known/acme-challenge    { try_files $uri $uri/ =404; }
        location /.well-known/pki-validation    { try_files $uri $uri/ =404; }

        # Let Nextcloud's API for `/.well-known` URIs handle all other
        # requests by passing them to the front-end controller.
        return 301 /index.php$request_uri;
    }

I just don’t know what and where should be on the proxy and on the nextcloud-nginx. Does anyone have a similar configuration and is willing to share some tips here?

Best,

Francis

I’m facing similar issue. I’m not entirely sure what’s wrong with my configuration.

One minor difference is that I’m using the official nextcloud-fpm docker container. But all the rest looks pretty similar.