Skip to content

Instantly share code, notes, and snippets.

@jed
Last active November 19, 2022 20:03
Show Gist options
  • Select an option

  • Save jed/bee2931a3a3e0c548833210211bd4efa to your computer and use it in GitHub Desktop.

Select an option

Save jed/bee2931a3a3e0c548833210211bd4efa to your computer and use it in GitHub Desktop.

Revisions

  1. jed revised this gist Nov 19, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Making your Mastodon account discoverable from your domain, using Cloudflare page rules
    # Making your Mastodon account discoverable from your own domain, using Cloudflare page rules

    Are you (1) moving to Mastodon, but (2) want to use your own Cloudflare-hosted domain for discoverability, and (3) don't want the hassle of managing your own instance?

  2. jed created this gist Nov 19, 2022.
    24 changes: 24 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    # Making your Mastodon account discoverable from your domain, using Cloudflare page rules

    Are you (1) moving to Mastodon, but (2) want to use your own Cloudflare-hosted domain for discoverability, and (3) don't want the hassle of managing your own instance?

    Well, here's a quick way to make sure that folks can find you when they search Mastodon with your domain. The UX is like this:

    <img width="600" alt="image" src="https://user-images.githubusercontent.com/4433/202832255-aaac7bbf-1747-4fa7-8acf-4d593487db7f.png">

    (If you're not on Cloudflare or would rather just host a file, use [Maarten Balliauw](https://mastodon.online/@maartenballiauw)'s post, [How to discover Mastodon account via custom domain](https://blog.maartenballiauw.be/post/2022/11/05/mastodon-own-donain-without-hosting-server.html), from which this technique was inspired.)

    ## Steps

    1. Go to the Cloudflare dashboard at https://dash.cloudflare.com, then
    2. click on the domain you want to use, then
    3. click __Rules__ in the left sidebar, then
    4. click __Create Page Rule__, then
    5. for the URL, enter `{domain-name}/.well-known/webfinger*` (for me it's `jed.is/.well-known/webfinger*`), then
    6. for the setting, choose __Forwarding URL__, then
    7. for the status code, choose __302 - Temporary Redirect__, then
    8. for the destination URL, enter `https://{mastodon-domain}/.well-known/webfinger?resource=acct:{username}@{mastodon-domain}` (for me it's https://mastodon.social/.well-known/webfinger?resource=acct:jed@mastodon.social).

    Once you're done the screen should like like this, at which point you click __Save and Deploy Page Rule__ to make it official.

    <img width="600" alt="image" src="https://user-images.githubusercontent.com/4433/202832346-c14411f6-0b74-4948-a769-b5b8c4698601.png">