Running a TLS termination proxy for Intercom

Setting Up Link Branding with Intercom requires that one “add a CNAME record and configure SSL in your domain provider’s website.” Namecheap has no such functionality, but an equivalent setup can be achieved using Caddy.

First, you’ll need to point the subdomain you are trying to setup at your web server. Once you’ve done that, use the following config to proxy the traffic through in a way that meets Intercom’s standards.

emails.mydomain.com {
        reverse_proxy https://businessname.intercom-mail.com {
                header_up Host {upstream_hostport}
                header_up -X-Forwarded-For
                header_up -X-Forwarded-Proto
                header_up -X-Forwarded-Host
        }
}