`health_check` - User Agent

In Caddy 1.0.3 is there a way to specify the “User Agent” for HTTP “health_check” requests?

I’m seeing "Go-http-client/1.1" user agent being used - sadly my up stream provider is blocking all requests by this user agent and will not change this.

I work around this for tls ask requests by proxying (with Caddy) those and adding in a different user agent header.

I’m not seeing an obvious way to do that for the health_check requests.
Any ideas?

If not with Caddy 1.x - perhaps Caddy 2?

1 Like

We can make this configurable for active health checks in Caddy 2, sure.

@DeanMarkTaylor I just whipped this together real quick. Can you give this commit a try? reverse_proxy: Configurable request headers on active health checks · caddyserver/caddy@44cb804 · GitHub

It should override any default headers with ones you specify:

    "handler": "reverse_proxy",
    "health_checks": {
        "active": {
            "headers": {
                "User-Agent": []
1 Like

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