1. Caddy version (caddy version
):
v2.2.0
2. How I run Caddy:
caddy-api on ubuntu vm
a. System environment:
ubuntu 20.04
b. Command:
systemctl start caddy-api
c. Service/unit/compose file:
# caddy-api.service
#
# For using Caddy with its API.
#
# This unit is "durable" in that it will automatically resume
# the last active configuration if the service is restarted.
#
# See https://caddyserver.com/docs/install for instructions.
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target
[Service]
User=caddy
Group=caddy
Environment="CONSUL_HTTP_ADDR=https://consul01p.net.work:8500"
ExecStart=/usr/bin/caddy run --environ --resume
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddyfile or JSON config:
N/A
3. The problem I’m having:
I’m not quite sure if this is possible in caddy but I’m moving my our internal rproxy solution from nginx to caddy and I’m stuck on one configuration and I’m not quite sure it is possible to do the same in caddy, here is the “tricky” part (for me at least)
if ($args ~ entryPoint=campaign_trackerv2) {
rewrite ^/(.*)$ /$1 last;
}
The rest of the nginx configuration is already adapt to caddy as it is basic reverse proxy stuff.
I am not the original editor of the nginx conf but already been told it is mandatory…
I tried to use nginx-adapter but does not seem to work anymore.
Thanks in advance for your help.
Regards,