Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

[Question] What are all the available options for expressions like %[dst_port] or %[req.hdr(host)] #671

Open
bond- opened this issue Sep 16, 2020 · 0 comments

Comments

@bond-
Copy link

bond- commented Sep 16, 2020

Can someone please point me to a link which lists all of the allowed expressions like %[dst_port] or %[req.hdr(host)]

I want to fill in forward headers like below:

"HAPROXY_0_BACKEND_HTTP_OPTIONS": "option forwardfor\n  http-request set-header X-Forwarded-Port %[dst_port]\n  http-request add-header X-Forwarded-Proto https if { ssl_fc }\n"

I have to fill in the below headers for the service to create a correct absolute link:

  • X-Forwarded-Host
  • X-Forwarded-Proto
  • X-Forwarded-Prefix

I have the host and port, but I would like to extract a piece of the context path:
For example, in the given URL being sent to marathon https://host/path/to/app-name/x/y/z I would like to extract /path/to/app-name and set to X-Forwarded-Prefix

If no such documentation link exists, can someone show me how it's done, and I can add a documentation link?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant