Comments (5)
Could be solved by using hdr_reg instead of hdr:
req.hdr_reg(host) -i ^foo\.bar\.com(:[0-9]+)?$
in file: kubernetes-ingress/controller-backend-switching.go :
import (
...
"regexp"
...
)
...
condTest = fmt.Sprintf("{ req.hdr_reg(host) -i %s } ", "^" + regexp.QuoteMeta(rule.Host) + "(:[0-9]+)?$")
...
However use of regex could slow down evaluating ACLs
from kubernetes-ingress.
Hi,
yes regex option is not the best option here.
i need to check it but maybe something like this would work
acl acl_1 hdr_beg(host) -i foo.bar
use_backend default-web-8181 if acl_1 { path_beg /web }
from kubernetes-ingress.
HAProxy proposes a few options:
- use regexes, but as you explained it's counter productive from a performance point of view and at scale
- use the hdr_dom comparison method which matches strings between '.' and ':'. But in such case, this would be equivalent to match *.foo.bar[:port]
- list all possible values in the current ACL: foo.bar foo.bar:80 or foo.bar:443 where it's relevant
The most accurate one is the latest one
from kubernetes-ingress.
Have ACLs been implemented in the build yet? I have an application to host, that appends :port to the host header, thereby not matching
- use_backend service1 if { req.hdr(host) -i foo.bar.com } { path_beg /foo }
I do not see any documentation, but I do see code in controller-acls.go for ACL methods.
from kubernetes-ingress.
Hi
This was fixed from v1.4.3
in the commit aac95d5
Fell free to reopen this issue if this does not answer your requirement.
from kubernetes-ingress.
Related Issues (20)
- frontend tcp-514: cannot bind socket (Permission denied) for [0.0.0.0:514] HOT 2
- haproxy ingress 1.11.2 reloads when number of backend pods scales HOT 10
- When specifying a server-proto annotation the check parameter is omitted
- Using both annotations "haproxy.org/cr-backend" and "haproxy.org/<parameter>" HOT 3
- Docs: when adjusting --sync-period, must also adjust initialDelaySeconds HOT 4
- Controller restarts haproxy every 5 minutes with message "restart required : Global config updated: " HOT 4
- Docs: Add info about --job-check-crd to documentation HOT 1
- Ingress Pods Fail to Start HOT 5
- Try to understand the mode for tcpcr in 3.0.0 HOT 5
- how enable only high secure ssl ciphers in haproxy ingress? HOT 3
- change route-acl into an array so multiple ACL's can be defined here. HOT 1
- Named backend server instead of generic SRV_x name HOT 7
- Not able to setup retry-on functionality globally, I tried multiple values.yaml ! Please correct me if i am wrong ! HOT 2
- Some clarification needed for handling canary deployments HOT 3
- Runtime API changes not getting synced between haproxy replicas HOT 3
- Unable to Configure Multiple Backends on the Same Port in TCP CRD HOT 7
- Possibility to add custom stick tables HOT 2
- rate-limit-requests HOT 1
- scale-server-slots on Ingress resource is ignored HOT 3
- feat request: Allow frontend selection annotation for Ingress resource
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kubernetes-ingress.