caddyserver/caddy

Proxy + filter plugin?

Closed this issue · 2 comments

1. What version of Caddy are you running (caddy -version)?

0.9.5

2. What are you trying to do?

Does the proxy directive work together with the filter plugin?

I setup Caddy as a proxy and have to rewrite some html content coming back from the upstream server. The filter plugin sounds like being able to rewrite content, but it seems to not kick in with the proxy. Is this possible somehow, or am I using it incorrectly?

3. What is your entire Caddyfile?

:1234 {
  filter rule {
    content_type text/html.*
    search_pattern Foo
    replacement Bar
  }
  proxy / http://www.foo.com {
    header_upstream Host www.foo.com
  }
}

4. How did you run Caddy (give the full command and describe the execution environment)?

./caddy (custom version w/ filter plugin included)

5. Please paste any relevant HTTP request(s) here.

open http://localhost:1234

6. What did you expect to see?

Bar

7. What did you see instead (give full error messages and/or log)?

Foo

8. How can someone who is starting from scratch reproduce the bug as minimally as possible?

Use Caddyfile from above, and start a caddy server w/ filter plugin.

mholt commented

Hey @larskluge, thanks for your question! But I think you'll have more success asking in the filter plugin's issue tracker: https://github.com/echocat/caddy-filter

Fair enough, will ask over there. Thanks @mholt