Skip to content

Instantly share code, notes, and snippets.

@danielrosehill
Created April 26, 2024 13:43
Show Gist options
  • Select an option

  • Save danielrosehill/38de07afacd6376adae07ff9a6941085 to your computer and use it in GitHub Desktop.

Select an option

Save danielrosehill/38de07afacd6376adae07ff9a6941085 to your computer and use it in GitHub Desktop.
Caddy configuration for a simple Ghost CMS Blog

Ghost CMS operates on port 2368 by default so we need to create a reverse proxy that routes incoming traffic over both HTTP and HTTPS onto that port.

Additionally we need to point Caddy to the installation path of Ghost on our server.

In my case, let's say Ghost lives at:

/var/www/mytechblog

Then we need to create this Caddyfile. Don't forget that 'www' and '/' are not the same so I configured both rules:

techblog.com {
      root * /var/www/techblog
      file_server

      reverse_proxy localhost:2368
}

www.techblog.com {
      root * /var/www/techblog
      file_server

      reverse_proxy localhost:2368
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment