Hello,
Hoping to get a bit of help with my migration from nginx. I’m not having much luck converting the following nginx directive into Caddy format.
If I go to the url /proxy/
it works, but not /proxy
Thanks for any help
Nginx directive which works
location /proxy/ {
rewrite /proxy/(.*) /$1 break;
proxy_pass http://192.168.1.3:61208/;
}
Caddyfile
mysite.com {
gzip
log /opt/caddy/logs/access.log
errors /opt/caddy/logs/errors.log
rewrite /proxy {
r (.*)
to /proxy/{1}
}
proxy /proxy 192.168.1.3:61208 {
transparent
without /proxy
}
Error logs (you can see where the rewrite doesn’t seem to trigger if I don’t put the forward slash - there are 404’s)
X.X.X.X - user@domain.com [24/Sep/2018:00:08:18 +0000] "GET /proxy/ HTTP/1.1" 200 353
X.X.X.X - user@domain.com [24/Sep/2018:00:08:18 +0000] "GET /proxy/api/3/all HTTP/1.1" 200 6827
X.X.X.X - user@domain.com [24/Sep/2018:00:08:19 +0000] "GET /proxy/api/3/all/limits HTTP/1.1" 200 854
X.X.X.X - user@domain.com [24/Sep/2018:00:08:19 +0000] "GET /proxy/api/3/args HTTP/1.1" 200 783
X.X.X.X - user@domain.com [24/Sep/2018:00:08:19 +0000] "GET /proxy/api/3/all/views HTTP/1.1" 200 2346
X.X.X.X - user@domain.com [24/Sep/2018:00:08:19 +0000] "GET /proxy/api/3/config HTTP/1.1" 200 1290
X.X.X.X - user@domain.com [24/Sep/2018:00:08:24 +0000] "GET /proxy HTTP/1.1" 200 353
X.X.X.X - user@domain.com [24/Sep/2018:00:08:24 +0000] "GET /api/3/config HTTP/1.1" 404 38
X.X.X.X - user@domain.com [24/Sep/2018:00:08:24 +0000] "GET /api/3/all/limits HTTP/1.1" 404 38
X.X.X.X - user@domain.com [24/Sep/2018:00:08:24 +0000] "GET /api/3/args HTTP/1.1" 404 38
X.X.X.X - user@domain.com [24/Sep/2018:00:08:24 +0000] "GET /api/3/all HTTP/1.1" 404 38
X.X.X.X - user@domain.com [24/Sep/2018:00:08:24 +0000] "GET /api/3/all/views HTTP/1.1" 404 38