-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Setting headers for http checks #1184
Comments
There currently isn't any support for controlling the headers of the HTTP check, marking as an enhancement. |
Tweaking the user agent comes to mind as well. |
IMHO, adding this feels like a slippery slope. I like the current balance where simple HTTP calls work fine as http checks and more complicated things can be accomplished through script checks. I would hate for us to turn Consul's http check into curl. |
That's a good point @ryanbreen - even headers brings to mind complexity around supporting multiple, etc. I'll change this to thinking for now, because we don't want to introduce a bunch of complexity. If there are a few extra options that are highly useful, it might make for a better experience, but we don't want a |
I can definitely see how this could get out of hand quickly...I think a few options that would cover 90% of the use case would be great. Otherwise you are going to end up with a lot of people resorting to cmd script just to run a curl just to change something like the protocol to https, etc. I will keep thinking about this...see if I can think of some middle ground |
Just found this issue after wanting to do this. My use case: I have an nginx instance with multiple virtual hosts and I'd like to health check their instances separately. RIght now I'm forced to use the command health check, e.g.:
It'd be great to not have to shell out in order to accomplish this relatively-basic functionality. It doesn't really feel like a slippery slope to me to allow arbitrary HTTP headers -- just looping through some object and calling Being able to replicate cURL's |
Is possible to send header "Accept: /" (by default)? |
Hi @truszkowski this was added in #1819 which will be going out in today's release of Consul 0.6.4. |
Headers seem pretty reasonable to support and there have been several requests. |
Setting the Host header would be extremely useful for us as well. |
We have the same requirement - we need to set |
Hi @ashald we'd take a PR for this - thank you! |
This feature would be very helpful in use cases of PaaS, such as with Cloud Foundry which allows you to identify unique app instance with the inclusion of a X-Cf-App-Instance header |
This commit introduce support for passing Host HTTP Header in HTTP health checks. Such check pattern is very common (for ex. when using a reverse-proxy) and you usually want to check the user facing port/API rather than the internal service exposed to 127.0.0.1. Fix hashicorp#1184
This commit introduce support for passing Host HTTP Header in HTTP health checks. Such check pattern is very common (for ex. when using a reverse-proxy) and you usually want to check the user facing port/API rather than the internal service exposed to 127.0.0.1. Fix hashicorp#1184 Change-Id: Ic130c01558eed312dd3bd7168482dd3908d32912
Since the Host header isn't set, we have to turn off an important security setting of our apps. For example, for a Django app, we have to set |
Fixed via #3107. |
@slackpad 👍 👍 👍 |
I dont see anything in the docs, is there any way to set a header for an http consul service check? I would imagine it useful for people to set headers such as 'X-Forwarded-Proto: https' on a check
The text was updated successfully, but these errors were encountered: