error_page 403 /core/templates/403.php; error_page 404 /core/templates/404.php; location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README) { deny all; } location / { ## The following 2 rules are only needed with webfinger rewrite ^/.well-known/host-meta /public.php?service=host-meta last; rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; rewrite ^/.well-known/carddav /remote.php/dav/ permanent; rewrite ^/.well-known/caldav /remote.php/dav/ permanent; rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; try_files $uri $uri/ /index.php$request_uri; }