From 18239f1215fc920d5fd40e27a36642bc9f2ec695 Mon Sep 17 00:00:00 2001 From: Benoit Date: Fri, 11 Oct 2024 23:01:58 +0900 Subject: [PATCH] Mastodon: Fix redirect web finger --- 03frontends.cfg | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/03frontends.cfg b/03frontends.cfg index 7662886..5d37a15 100644 --- a/03frontends.cfg +++ b/03frontends.cfg @@ -288,9 +288,13 @@ frontend frontend_default # Redirect www to non-www domains http-request redirect prefix https://%[hdr(host),regsub(^www\.,,i)] code 301 if { hdr_beg(host) -i www. } - # Redirect /.well-known/webfinger to mastodon.benoit.jp.net + # ACL to match requests for /.well-known/webfinger acl webfinger_request path_beg /.well-known/webfinger - http-request redirect location https://mastodon.benoit.jp.net%[capture.req.uri] if webfinger_request + # ACL to check if the host is not mastodon.benoit.jp.net + acl not_mastodon hdr(host) !mastodon.benoit.jp.net + + # Redirect if it's a webfinger request and the host is not mastodon.benoit.jp.net + http-request redirect location https://mastodon.benoit.jp.net%[capture.req.uri] if webfinger_request not_mastodon acl letsencrypt path_beg /.well-known/acme-challenge/