From bc527b0c701542493994d8c3aacc5ebfe6fbedfa Mon Sep 17 00:00:00 2001 From: Deimos Date: Sat, 31 Aug 2019 18:39:45 -0600 Subject: [PATCH] Serve Tildes robots.txt on tild.es as well --- salt/salt/nginx/tildes-shortener.conf.jinja2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/salt/salt/nginx/tildes-shortener.conf.jinja2 b/salt/salt/nginx/tildes-shortener.conf.jinja2 index 37753d5..019f3fd 100644 --- a/salt/salt/nginx/tildes-shortener.conf.jinja2 +++ b/salt/salt/nginx/tildes-shortener.conf.jinja2 @@ -1,3 +1,4 @@ +{% from 'common.jinja2' import app_dir -%} server { listen 443 ssl http2; listen [::]:443 ssl http2; @@ -19,7 +20,12 @@ server { return 301 https://tildes.net; } - # Will match all addresses *except* the root + # Serve the same robots.txt file as on the site itself + location = /robots.txt { + root {{ app_dir }}/static; + } + + # Will match all addresses *except* exact matches above location / { # Strip any trailing slash while redirecting rewrite ^/(.*)/?$ https://tildes.net/shortener/$1 permanent;