diff --git a/roles/nextcloud/files/nginx-site-nextcloud.j2 b/roles/nextcloud/files/nginx-site-nextcloud.j2 index 63e938d..dccc1e0 100644 --- a/roles/nextcloud/files/nginx-site-nextcloud.j2 +++ b/roles/nextcloud/files/nginx-site-nextcloud.j2 @@ -64,6 +64,23 @@ location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; } location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; } + # Restrict status pages access + location = /status.php { + access_log off; + {% if common_netdata_enable is defined -%} + allow ::1; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $path_info; + fastcgi_pass php-handler; + {%- endif %} + deny all; + } + location = /ocs/v2.php/apps/serverinfo/api/v1/info { + access_log off; + deny all; + } + # Ensure this block, which passes PHP files to the PHP process, is above the blocks # which handle static assets (as seen below). If this block is not declared first, # then Nginx will encounter an infinite rewriting loop when it prepends `/index.php`