summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nginx.conf8
1 files changed, 8 insertions, 0 deletions
diff --git a/nginx.conf b/nginx.conf
index a7e345a..d8a15ca 100644
--- a/nginx.conf
+++ b/nginx.conf
@@ -89,6 +89,14 @@ server {
=404;
}
+ # Direct .txt requests must bypass the curl/wget suffix map, otherwise a
+ # request for /robots.txt is looked up as /robots.txt.txt. No add_header
+ # here: mime.types supplies text/plain, `charset` supplies the charset, so
+ # the server-level security headers are inherited normally.
+ location ~* \.txt$ {
+ try_files $uri =404;
+ }
+
location / {
try_files
$uri$final_suffix