Mastodon: Fix redirect web finger

This commit is contained in:
Benoit 2024-10-11 23:01:58 +09:00
parent 1c2684b4be
commit 18239f1215
Signed by: Benoit
SSH key fingerprint: SHA256:kFsX94Kq6z/6CY0dX+7/FpAeJC0QlMhJVY+B7NYrOmA

View file

@ -288,9 +288,13 @@ frontend frontend_default
# Redirect www to non-www domains # Redirect www to non-www domains
http-request redirect prefix https://%[hdr(host),regsub(^www\.,,i)] code 301 if { hdr_beg(host) -i www. } 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 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/ acl letsencrypt path_beg /.well-known/acme-challenge/