Http.filter for Caddy 2?

Is there http.filter for Caddy 2?

I am even wondering if I should use version 2 yet because the documentation seems lacking and this is pretty much my first usage with much complex configurations since the last time many years ago.

1 Like

It’s not finished yet, but what is lacking, specifically? There should be plenty to learn from as far as most aspects of using the software are concerned.

Yes, definitely. :slight_smile:

I’m not aware of it being made yet, but it’s on the table if anyone wants to pick it up.

I have finished configuring 1 of my website. I’m pretty happy to be honest.

Sorry, but I couldn’t point out which part is lacking. Seems that it just need some time to get used to the docs. Looks pretty good when I knew where to find what I’m looking for.

My website can still run without http.filter. But it would be really great to have it back in version 2.

1 Like

Also, How do I set error page? Currently Caddy serves blank page with http error code response.

Great to hear that you’re happy so far!

Yeah, sounds good. Spend some time in the new docs and if you still don’t find what you need to know, just open an issue or submit a PR: GitHub - caddyserver/website: The Caddy website

Error handling is one of the last things yet to be added to the Caddyfile before v2 RCs, but we were just talking about this the other day on our dev slack.

For now, you can do this in the JSON for your HTTP server. First, Caddy will route requests to the routes – these are your primary handlers. If there is an error, it is returned all the way back to the server, where the server adds the error information to the request context, and then it calls the routes configured in errors/routes as you can see on that page. Error routes work the exact same as primary routes.

It will probably be similar in the Caddyfile, like an errors directive that opens a block and has any other directives inside it. Very powerful, very flexible error handling. If you have any preferences, let’s chat about it in our issue tracker (or I guess you can reply here, but for actionable dev items we can discuss it on GitHub).

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