1. Caddy version
2.46
2. How I run Caddy:
systemctl [enable | start | stop | restart ] caddy
a. System environment:
Debian 11.2
b. Command:
systemctl [enable | start | stop | restart ] caddy
c. Service/unit/compose file:
N/A
d. My complete Caddyfile or JSON config:
listmonk.14servers.net {
# Set this path to your site's directory.
# root /opt
# Enable the static file server.
file_server
# Another common task is to set up a reverse proxy:
reverse_proxy * localhost:9000
# Add compression
encode zstd gzip
}
3. The problem Iâm having:
Iâm using Caddy as reverse proxy with ListMonk - an email marketing/newsletter program which, like Caddy, is also a single-file executable written in Go.
Iâve placed the ListMonk executable in /opt
My Caddyfile above is very simple, likely too simple:
My ListMonk instance is able to successfully send emails but is failing to detect open or clicked links.
I suspect this is because my caddy file is not set up properly to let ListMonkâs own REST-API be publicly accessed via the API below:
Iâve tried uncommenting the following line from my Caddyfile
âââroot /optâââ
But caddy validate returns following error:
âââ
root@hector:/etc/caddy# nano Caddyfile
root@hector:/etc/caddy# caddy validate
2022/01/31 14:54:34.781 INFO using adjacent Caddyfile
validate: adapting config using caddyfile: parsing caddyfile tokens for ârootâ: Caddyfile:13 - Error during parsing: Wrong argument count or unexpected line ending after ârootâ
âââ
The above error seems curious to me, but given that the application works at all when the root /opt line is commented out entirely leads me to believe Iâm missing (not understanding) something else important regarding the exposure of REST APIâs for proxied apps.