location /.well-known/webfinger {
add_header Access-Control-Allow-Origin '*';
return 301 https://mastodon.bitsnbytes.chat/$request_uri;
}
是否可以将此 Nginx 转换为 Apache2 .htaccess
?
答案1
在 Apache / 中.htaccess
这将是这样的:
Header always set Access-Control-Allow-Origin "*"
RedirectMatch 301 ^/(\.well-known/webfinger.*) https://mastodon.bitsnbytes.chat/$1
答案2
我让它工作了:
RewriteEngine On
RewriteRule ^(.well-known/webfinger.*)$ https://mastodon.mydomain.tld/$1 [L,R=301]
Header add Access-Control-Allow-Origin "*"