From 8f59f2549a15b6c0620e1f50c2e9cae63a089494 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Thu, 15 Apr 2021 20:59:25 +0200 Subject: [PATCH] robots.txt added This fixes the randomly appearing 404 error in Auth (issue #1232) --- allianceauth/static/robots.txt | 2 ++ docs/installation/apache.md | 10 +++++++++- docs/installation/nginx.md | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 allianceauth/static/robots.txt diff --git a/allianceauth/static/robots.txt b/allianceauth/static/robots.txt new file mode 100644 index 00000000..1f53798b --- /dev/null +++ b/allianceauth/static/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/docs/installation/apache.md b/docs/installation/apache.md index 9be3aa4e..5ffd1f13 100644 --- a/docs/installation/apache.md +++ b/docs/installation/apache.md @@ -45,17 +45,25 @@ Place your virtual host configuration in the appropriate section within `/etc/ht ``` ServerName auth.example.com - + ProxyPassMatch ^/static ! + ProxyPassMatch ^/robots.txt ! + ProxyPass / http://127.0.0.1:8000/ ProxyPassReverse / http://127.0.0.1:8000/ ProxyPreserveHost On Alias "/static" "/var/www/myauth/static" + Alias "/robots.txt" "/var/www/myauth/static/robots.txt" + Require all granted + + SetHandler None + Require all granted + ``` diff --git a/docs/installation/nginx.md b/docs/installation/nginx.md index 15b2bcd5..37cf91bf 100644 --- a/docs/installation/nginx.md +++ b/docs/installation/nginx.md @@ -69,6 +69,10 @@ server { autoindex off; } + location /robots.txt { + alias /var/www/myauth/static/robots.txt; + } + # Gunicorn config goes below location / { include proxy_params;