Reverse proxy url rewrites

if I declare in my Caddyfile something like

dev.prj.ex.com {
    proxy / localhost:8001
}

when I visit that virtual host, I get redirected to localhost:8001 - but I don’t want that. I want it to remain dev.prj.ex.com in the browser. how do I tell Caddy to do that?

seems related to this issue: https://github.com/mholt/caddy/issues/1254

If I’m reading that issue right, you either need to specify transparent or always include the trailing slash.

updating to use ‘transparent’ should solve the issue

dev.prj.ex.com {
   proxy / localhost:8001
   transparent
}

so I tried it but get:

2016/11/17 22:01:02 Caddyfile:3 - Parse error: Unknown directive ‘transparent’

running v 0.9.3

here’s my Caddyfile

dev.prj.ex.com {
  tls off
  transparent
  proxy / localhost:32790
}

in fact, in looking through Welcome — Caddy Documentation I see no such directive

Typo in @tobya’s answer; try this:

dev.prj.ex.com {
  tls off
  proxy / localhost:32790 {
     transparent
  }
}
1 Like

ah. that did it. #awesome. and thank you Matt, for maintaining this. it’s a terrific piece of software

1 Like

Thank you! And thanks to all the contributors who maintain it when I’m busy with other stuff :wink:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.