Skip to content

"request-redirect" annotation always redirects to http #613

@fgmpe

Description

@fgmpe

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions