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
HAProxy captured response header Location not in Log #2512
Comments
It's expected, captures work very early, before any other rules, so that it's possible to take a copy of what is fed into haproxy before it's possible modified or deleted. In your case, the capture happens on the response from the server, before headers are rewritten, but you don't go that far with the redirect rule that interrupts request processing and forges a response without doing any response processing. There is a trick you could use however. By adding an "http-after-response" rule, you can insert rules to be applied before the response is sent, that will take a capture of the header and copy it into a variable, that you will log:
Testing it does indeed work for me, look at the end of the line:
|
Hello Willi, |
What do you think of the following solution?
|
You can also use |
Awesome.
|
I must confess I had totally forgotten about |
Detailed Description of the Problem
I have a problem with the logging of captured response headers when a redirect is performed by HAProxy.
Actual log line
Expected Behavior
Expected log line
Steps to Reproduce the Behavior
docker run -d --name my-running-haproxy -v .:/usr/local/etc/haproxy:ro -p8080:80 --sysctl net.ipv4.ip_unprivileged_port_start=0 haproxy
curl -I localhost:8080
docker logs my-running-haproxy
Do you have any idea what may have caused this?
Unfortunately not.
Do you have an idea how to solve the issue?
No response
What is your configuration?
Output of
haproxy -vv
Last Outputs and Backtraces
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: