DEV Community

Cover image for Webflow + Ghost blog with Caddy
Vitaly Davydov
Vitaly Davydov

Posted on • Originally published at

Webflow + Ghost blog with Caddy

Modern SaaS applications usually run a landing page, blog, and the main app separately. For a landing page, you may want to use Tilda, Webflow, or other web-builders. For a blog, it’s common to use self-hosted CMS such as WordPress, Ghost, or others.

It’s crucially important to index the main domain instead of a subdomain for SEO purposes. You want as many links to your main domain as possible. The more content on, the more Google will index it.

Running Ghost blog on a subdomain such as is easy, just create a new A-record in your DNS provider and point it to a machine with running Ghost instance. If you want to run on a Webflow and being self-hosted Ghost you need a reverse-proxy server.
Alt Text
Reverse proxy server
From a devops point of view our goals are:

  1. -> Webflow
  2.* -> Webflow
  3. -> self hosted Ghost blog
  4. ->

We’re going to use Caddy for reverse-proxy. The reason is Docker-friendly config, super fast to deploy without deep knowledge of devops (hey, Nginx). Find the official Caddy image here. Caddy needs you to mount volumes for proper working.

We’ll host Ghost and Caddy on the same machine and in a single docker-compose.yml file.

version: "3.7"

   image: caddy:2
   restart: unless-stopped
     - "80:80"
     - "443:443"
     - $PWD/Caddyfile:/etc/caddy/Caddyfile
     - $PWD/site:/srv
     - caddy_data:/data
     - caddy_config:/config
   image: ghost:3
     NODE_ENV: production
     - ./blog:/var/lib/ghost/content
Enter fullscreen mode Exit fullscreen mode

Now for Caddyfile: {
   redir{uri} #point to subdirectory
} {
   redir /blog /blog/ #trailing slash
   reverse_proxy /blog/* ghost:2368 { #proxy to Ghost container
       header_up Host {host}
   reverse_proxy { #proxy to Webflow
       header_up Host {host}
Enter fullscreen mode Exit fullscreen mode

Run *docker-compose up -d *and here you go!

By default, Caddy passes thru incoming headers to the backend—including the Host header—without modifications, with two exceptions:

  • It adds or augments the X-Forwarded-For header field.
  • It sets the X-Forwarded-Proto header field.

Read more in their docs


Point A record for the main domain to your IP.
Alt TextChange your DNS A record and point to a VM
In Webflow turn off SSL proxy as Caddy will serve it for you automatically (very cool, yeah? Without a certbot).
Alt TextTurn off SSL in Webflow as Caddy will create a certificate for you
That’s it!

Top comments (0)