marathon-lb
marathon-lb copied to clipboard
HAPROXY_0_HTTP_FRONTEND_ACL not applying in the haproxy config
I use v 1.7
I am trying to set up routing to a service passed on path_reg so my definition looks like this
"labels": {
"HAPROXY_GROUP": "external",
"HAPROXY_0_VHOST": "example.com",
"HAPROXY_0_HTTP_FRONTEND_ACL": "acl path_{backend} path_reg /api/v3/[a-z]+/\n use_backend {backend} if path_{backend}\n"
}
This rule does not apply
hitting :9090/_haproxy_getconfig
.. the configuration does not contain my rule
I removed --haproxy-map flag (since someone here suggested that in a comment on another issue .. still no luck and things are the same
I also have other questions which are not clear in the documentation
assuming I get things working with acls If I specify "HAPROXY_0_PATH" and another acl which has a path criterion would that translate to a logical OR or an AND?
Is there a way I can use path_reg or dir in "HAPROXY_0_PATH" instead of path_beg? since HAPROXY_0_PATH currently works fine for me bug not to my use case which needs regex matching
can someone pls help , i am also facing same issue
Having the same issue on both HAPROXY_0_HTTP_FRONTEND_ACL and HAPROXY_0_HTTPS_FRONTEND_ACL
Same problem using the latest 1.7
Same problem
We have been mocking around with this for a while, and it looks to us that if you dont involve the acl host part as well:
acl host_{cleanedUpHostname} hdr(host) -i {hostname}
before the 'acl path'-part you will be missing a variable which the code depends on. For some reason.
By including the host part, the rule shows up in the haproxy config.
Another thing you should be aware of is that you're replacing the whole template, so it just inserts the string directly into the config. In other words you must provide the indentation yourself.
The last "gottcha" is to remember that it is python-regex and not just plain-regex =)
Any updates on this? We're facing the same issue
Same issue with haproxy v 1.8.1 a Working regexp does not work in haproxy
Just in case it may help someone.
We encountered the same issue and it was because we were not using HAPROXY_HTTPS_FRONTEND_ACL_WITH_AUTH
and HAPROXY_HTTPS_FRONTEND_ACL_WITH_AUTH_AND_PATH
(and their equivalent for HTTP) when using authentication and/or path matching with HAPROXY_{n}_PATH
.
My workaround was use HAPROXY_0_HTTP_FRONTEND_ACL_ONLY_WITH_PATH
label with correct indentation and line breaks. Everything else IS'T worked.
"labels": {
"HAPROXY_0_HTTP_FRONTEND_ACL_ONLY_WITH_PATH": " acl path_{backend} path_reg {path}\n",
"HAPROXY_0_REDIRECT_TO_HTTPS": "true",
"HAPROXY_GROUP": "internal",
"HAPROXY_0_HTTP_BACKEND_PROXYPASS_PATH": "/dev",
"HAPROXY_0_PATH": "^/cars/audi/.*/edit$ ^/dev/.*",
"environment": "dev",
"HAPROXY_0_VHOST": "cars.com",
"HAPROXY_0_HTTPS_FRONTEND_ACL_ONLY_WITH_PATH": " acl path_{backend} path_reg {path}\n"
},