kubernetes-ingress
kubernetes-ingress copied to clipboard
"request-redirect" annotation always redirects to http
I have Ingress with request-redirect annotation:
## ...
annotations:
haproxy.org/request-redirect: www.example.org
spec:
rules:
- host: example.com
## ...
When I send request for https://example.org, I expect response with header Location: https://www.example.org, but in reality I get Location: http://www.example.org
HAProxy configuration line is always rendered with hardcoded http protocol.
frontend https
## ...
http-request redirect location http://www.example.org%[capture.req.uri] code 302 if { var(txn.path_match) -m dom 000.... }
## ...
It would be great if this could be customized with new annotation the same way as request-redirect-code allows to customize the redirect code, or directly in existing annotation value:
annotations:
## proposal 1 - new annotation for protocol override
haproxy.org/request-redirect-protocol: https
## proposal 2 - existing annotation with optional protocol
haproxy.org/request-redirect: https://www.example.org
It looks like it's already prepared here. But I can't see how to set the value of r.SSLRequest with Ingress annotation.
Hi @fgmpe , Your second idea seems to be the best as it's more direct. I'll check if the team is ok with that.