From c3e7bb1d88f50f60dc5b171aa338a7e149cf450c Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sat, 18 Feb 2023 23:11:03 +0100 Subject: [PATCH] fix "location" directive is not allowed here --- conf/nginx.conf | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 596bb72..288d231 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -26,12 +26,14 @@ location __PATH__/ { include conf.d/yunohost_panel.conf.inc; } -location ^~ /.well-known { - +# redirect the account_domain .well-known to the domain one +location = /.well-known/webfinger { if ($is_account_domain = 1) { - location = /.well-known/webfinger { return 301 __PATH__/.well-known/webfinger; } - location = /.well-known/nodeinfo { return 301 __PATH__/.well-known/nodeinfo; } + return 301 __PATH__/.well-known/webfinger; + } +} +location = /.well-known/nodeinfo { + if ($is_account_domain = 1) { + return 301 __PATH__/.well-known/nodeinfo; } - - try_files $uri $uri/ =404; }