caddy-exec icon indicating copy to clipboard operation
caddy-exec copied to clipboard

pass_thru option

Open RubixDev opened this issue 4 years ago • 0 comments

I want caddy to run a command for updating an html file every time I access that page. My current Caddyfile looks like this::

example.com {
  root * /var/www/{host}
  route /stats {
    exec command-to-update-html-file-at /var/www/example.com/stats/index.html
  }
  file_server
}

When I access example.com/stats the command is executed but caddy responds with {"status":"success"}. Only accessing example.com/stats/index.html directly shows the generated html.

Is there (or can you add) an option to not respond directly but continue to the file_server directive?

RubixDev avatar Mar 21 '22 09:03 RubixDev