Setup a Reverse Proxy with Ghost & Leadpages


I’m self-hosting a Ghost blog and would like to run it on a subdirectory from my main domain that is on Leadpages.

Looking at Digital Ocean, I found “Caddy”, but I’m totally new and not used to this.

I need help understanding how to write the Caddyfile, and how to run or activate it.

Also, I have specific URLs today: all my blog articles are parameters.

Meaning I am transitioning from: to

Do you think it’s possible to setup this inside the Caddyfile? If so, how?

So, far, I have: {
        redir /blog /blog/
        reverse_proxy* http://ghost_server_ip:2368

        reverse_proxy* http://ghost_server_ip:2368

        reverse_proxy / myleadpagesip
        reverse_proxy /* myleadpagesip/{uri}

Also: How do I test it without doing the changes in my Cloudflare yet?

Thank you so much to anyone who helps,

Please fill out the help topic template, as per the forum rules.

You might have missed it if you tried to open a topic while looking at the wrong forum category. Click on New Topic, choose the Help category, then copy and paste the template as a reply into this topic, and fill it out.

That said, you’re probably looking for the rewrite directive:

Please also read about how request matching works:


Will take a look and upload my question in this category if needed, thanks.

Posted with the right form here: Writing a CaddyFile for Reverse Proxy

This topic was automatically closed after 30 days. New replies are no longer allowed.