Giter Site home page Giter Site logo

Comments (5)

ejez avatar ejez commented on September 3, 2024

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.

oktalz avatar oktalz commented on September 3, 2024

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.

bedis avatar bedis commented on September 3, 2024

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.

mikecurrancs avatar mikecurrancs commented on September 3, 2024

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.

Mo3m3n avatar Mo3m3n commented on September 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.