From 06bfcbd266a5501eaae7ad4d5503bcbd0511b3a8 Mon Sep 17 00:00:00 2001 From: Abdulrhmn Ghanem Date: Sat, 22 Jul 2023 03:33:38 +0300 Subject: [PATCH] Use exact match modifier `=` for /robots.txt The equal sign in the location block forces an exact match with the path requested and then stops searching for any more matches. --- nginx/kitspace.template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nginx/kitspace.template b/nginx/kitspace.template index 0453c70d4e..1b1a19402b 100644 --- a/nginx/kitspace.template +++ b/nginx/kitspace.template @@ -4,7 +4,7 @@ server { server_name @KITSPACE_DOMAIN; - location /robots.txt { + location = /robots.txt { add_header Content-Type text/plain; return 200 "@KITSPACE_ROBOTS_TXT"; } @@ -35,7 +35,7 @@ server { server_name gitea.@KITSPACE_DOMAIN; - location /robots.txt { + location = /robots.txt { add_header Content-Type text/plain; return 200 "@KITSPACE_ROBOTS_TXT"; } @@ -73,7 +73,7 @@ server { server_name meilisearch.@KITSPACE_DOMAIN; - location /robots.txt { + location = /robots.txt { add_header Content-Type text/plain; return 200 "@KITSPACE_ROBOTS_TXT"; }