mesosphere / marathon-lb

Marathon-lb is a service discovery & load balancing tool for DC/OS
Apache License 2.0
450 stars 300 forks source link

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

Open bond- opened 4 years ago

bond- commented 4 years ago

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:

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?