Dynamically enrich request header


I am currently using OpenResty as a webserver to handle SSL termination. In OpenResty you can execute LUA scripts and manipulate requests on the fly.

I would like to do a similar thing with Caddy and execute some GO code for every request and at add a request header which is then used by the application where I proxy the request to. Is this possible with Caddy? I couldn’t find any example.

Thank you very much!

Hi @jens, there’s no way to configure Caddy to execute arbitrary Go code on a given request.

You might consider extending Caddy via plugin to do what you need.