We have a website that uses an external analytics app called PostHog.com. Their app installation is straightforward, just paste their script into the HEAD of your site and it starts working. The script loads their service which is hosted at app[dot]posthog[dot]com. What we want to do is to use Caddy to call this service from a custom sub-domain.
Here’s a guide by PostHog that explains how to do this:
So basically instead of the script calling app.posthog.com it will call analytics[dot]our-site[dot]com and this call will be forwarded to app[dot]posthog[dot]com.
Our website is hosted with Heroku and we use Cloudflare for the DNS and SSL. What you can do is create a new server on Digital Ocean or AWS for example, install Caddy there and configure the reverse proxy. After you do that, we’ll go and remove the call to app[dot]posthog[dot]com and put instead a call to analytics[dot]our-site[dot]com in the HEAD of our site.
We are happy to pay by the hour to whoever can take this task off of our hands. Please reply here or send me an email if you’re interested: firstname.lastname@example.org.