Skip to content
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

[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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant