Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to set which HTTP method to use for active health checks #6453

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

jbro
Copy link
Contributor

@jbro jbro commented Jul 11, 2024

Changes

Added the option Method to the ActiveHealthChecks struct, which optionally sets the HTTP method used for the health check requests.

Rational

It would be good to be able to use the HEAD HTTP method to limit transfers on upstreams that respond with a large body, or other methods for upstreams that only respond sensibly on eg. POST.

I specifically have a JSON RPC upstream that I would like to test and see if it is working. It has a well defined response body to a POST request, that lets the active health check determine if the underlying service is actually up and ready to serve requests.

@CLAassistant
Copy link

CLAassistant commented Jul 11, 2024

CLA assistant check
All committers have signed the CLA.

@mholt mholt enabled auto-merge (squash) July 11, 2024 12:41
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the enhancement! LGTM.

@mholt mholt merged commit dc2a5d5 into caddyserver:master Jul 11, 2024
23 checks passed
@jbro jbro deleted the activehealth-check-method branch July 11, 2024 13:25
@francislavoie
Copy link
Member

This is missing Caddyfile support.

@jbro
Copy link
Contributor Author

jbro commented Jul 12, 2024

This is missing Caddyfile support.

Open PR to add support here: #6454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ⚙️ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants