diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf index 36f591d4..cf220978 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf +++ b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf @@ -77,12 +77,21 @@ http { # Uncomment it if you're planning to use this app. #rewrite ^/.well-known/webfinger /public.php?service=webfinger last; - location = /.well-known/carddav { - return 301 $scheme://$host/remote.php/dav; - } + location ^~ /.well-known { + # The following 6 rules are borrowed from `.htaccess` - location = /.well-known/caldav { - return 301 $scheme://$host/remote.php/dav; + location = /.well-known/carddav { + return 301 $scheme://$host/remote.php/dav; + } + location = /.well-known/caldav { + return 301 $scheme://$host/remote.php/dav; + } + # Anything else is dynamically handled by Nextcloud + location ^~ /.well-known { + return 301 $scheme://$host/index.php$uri; + } + + try_files $uri $uri/ =404; } # set max upload size