1. Caddy version (caddy version
):
v2.2.1
2. How I run Caddy:
sudo nano Caddyfile
caddy reload
a. System environment:
DigitalOcean Droplet — Ubuntu 18.04
b. Command:
sudo nano Caddyfile
caddy reload
c. Service/unit/compose file:
Nothing other than what's setup with Caddy on Digital Ocean.
d. My complete Caddyfile or JSON config:
abc.com {
redir /blog /blog/
reverse_proxy abc.com/blog/* http://ghost_server_ip:2368
reverse_proxy / myleadpagesip
reverse_proxy /* myleadpagesip/{uri}
}
3. The problem I’m having:
Hello!
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: abc.com/blog/?p=article_1 to abc.com/blog/article_1/.
Do you think it’s possible to setup this inside the Caddyfile? If so, how?
So, far, I have:
abc.com {
redir /blog /blog/
reverse_proxy abc.com/blog/* http://ghost_server_ip:2368
reverse_proxy / myleadpagesip
reverse_proxy /* myleadpagesip/{uri}
}
4. Error messages and/or full log output:
I don’t understand what I’m supposed to have exactly in the Caddyfile. When I go to the URL /, I either have 502 or infinite loops or DNS errors. Errors don’t matter much given that my writing and understanding of Caddyfiles is wrong anyway.
5. What I already tried:
Looking for tutorials and reading the Caddy documentation, but nothing really worked (I haven’t been able to see the leadpages or ghost pages).
6. Links to relevant resources:
/
Thank you so much to anyone who helps,
Jeremy