Skip to content

Split-domain deployments

This guide explains how to have usernames like but run the GoToSocial instance itself on a subdomain like Configuring this type of deployment layout must be done before starting GoToSocial for the first time.


You cannot change your domain layout after you've federated with someone. Servers are going to get confused and you'll need to convince the admin of every instance that's federated with you before to mess with their database to resolve it. It also requires regenerating the database on your side to create a new instance account and pair of encryption keys.


The way ActivityPub implementations discover how to map your account domain to your host domain is through a protocol called webfinger. This mapping is typically cached by servers and hence why you can't change it after the fact.

It works by doing a request to https://<account domain>/.well-known/webfinger? At this point, a server can return a redirect to where the actual webfinger endpoint is, https://<host domain>/.well-known/webfinger? or may respond directly. The JSON document that is returned informs you what the endpoint to query is for the user:

  "subject": "",
  "aliases": [
  "links": [
      "rel": "",
      "type": "text/html",
      "href": ""
      "rel": "self",
      "type": "application/activity+json",
      "href": ""

ActivityPub clients and servers will now use the entry from the links array with rel self and type application/activity+json to query for further information, like where the inbox is located to federated messages to.


There are 2 configuration settings you'll need to concern yourself with:

  • host, the domain the API will be served on and what clients and servers will end up using when talking to your instance
  • account-domain, the domain user accounts will be created on

In order to achieve the setup as described in the introduction, you'll need to set these two configuration options accordingly:



The host must always be the DNS name that your GoToSocial instance runs on. It does not affect the IP address the GoToSocial instance binds to. That is controlled with bind-address.

Reverse proxy

When using a reverse proxy you'll need to ensure you're set up to handle traffic on both of those domains. You'll need to redirect a few endpoints from the account domain to the host domain.

Redirects are typically used so that the change of domain can be detected client side. The endpoints to redirect from the account domain to the host domain are:

  • /.well-known/webfinger
  • /.well-known/host-meta
  • /.well-known/nodeinfo


Do not proxy or redirect requests to the API endpoints, /api/..., from the account domain to the host domain. This will confuse heuristics some clients use to detect a split-domain deployment resulting in broken login flows and other weird behaviour.


In order to configure the redirect, you'll need to configure it on the account domain. Assuming the account domain is and the host domain is, the following configuration snippet showcases how to do this:

server {
  server_name;                                                      # account-domain

  location /.well-known/webfinger {
    rewrite ^.*$ permanent;    # host

  location /.well-known/host-meta {
      rewrite ^.*$ permanent;  # host

  location /.well-known/nodeinfo {
      rewrite ^.*$ permanent;   # host


If is running on Traefik, we could use labels similar to the following to setup the redirect.

  image: foo
  # Other stuff
    - 'traefik.http.routers.myservice.rule=Host(``)'                                                                # account-domain
    - 'traefik.http.middlewares.myservice-gts.redirectregex.permanent=true'
    - 'traefik.http.middlewares.myservice-gts.redirectregex.regex=^https://(.*)/.well-known/(webfinger|nodeinfo|host-meta)$$'  # host
    - 'traefik.http.middlewares.myservice-gts.redirectregex.replacement=https://social.$${1}/.well-known/$${2}'                # host
    - 'traefik.http.routers.myservice.middlewares=myservice-gts@docker'

Caddy 2

Ensure that the redirect is configured on the account domain in your Caddyfile. The following example assumes the account domain as, and host domain as {                                                                    # account-domain
        redir /.well-known/host-meta*{uri} permanent  # host
        redir /.well-known/webfinger*{uri} permanent  # host
        redir /.well-known/nodeinfo*{uri} permanent   # host