From f3768217d18c69d6cc3804a484efba5c36928a84 Mon Sep 17 00:00:00 2001 From: opi Date: Tue, 15 Mar 2016 00:07:36 +0100 Subject: [PATCH] [enh] Redirect most of 404 to maindomain.tld/yunohost/sso --- data/templates/nginx/yunohost_admin.conf | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/data/templates/nginx/yunohost_admin.conf b/data/templates/nginx/yunohost_admin.conf index 0660eca46..bcd99493b 100644 --- a/data/templates/nginx/yunohost_admin.conf +++ b/data/templates/nginx/yunohost_admin.conf @@ -29,11 +29,14 @@ server { return 302 https://$http_host/yunohost/admin; } - # Block crawlers bot location /yunohost { - if ($http_user_agent ~ (crawl|Googlebot|Slurp|spider|bingbot|tracker|click|parser|spider|facebookexternalhit) ) { - return 403; - } + # Block crawlers bot + if ($http_user_agent ~ (crawl|Googlebot|Slurp|spider|bingbot|tracker|click|parser|spider|facebookexternalhit) ) { + return 403; + } + + # Redirect most of 404 to maindomain.tld/yunohost/sso + access_by_lua_file /usr/share/ssowat/access.lua; } include conf.d/yunohost_admin.conf.inc;