Comments (6)
FYI, next version of this ingress controller will have per-backend mruby scripting, which kicks in after backend has been chosen. It will be the bast place to rewrite request path.
from nghttpx-ingress-lb.
There is no feature to strip path prefix at the moment.
nghttpx supports mruby user script which can alter request path, but it happens before routing a request to the backend. If I understand it correctly, you need to rewrite path after determining backend service.
from nghttpx-ingress-lb.
@tatsuhiro-t thanks for your comment. Yes, that is correct, I need to rewrite path after determining backend service.
Do you mean to say that when mruby script executes, the backend service has not yet been determined based on path matching, so rewriting path there would cause it to fail the match?
I may have to modify the application code itself to honor the prefix if I cannot strip it.
from nghttpx-ingress-lb.
Also, maybe there is the possibility of defining the matching paths to just be filing, public and admin in my example, but let consumers use the prefix.
Then, in the mruby script, rewrite path to not have prefix. Then path matching should pass.
from nghttpx-ingress-lb.
Do you mean to say that when mruby script executes, the backend service has not yet been determined based on path matching, so rewriting path there would cause it to fail the match?
Yes
Also, maybe there is the possibility of defining the matching paths to just be filing, public and admin in my example, but let consumers use the prefix.
Then, in the mruby script, rewrite path to not have prefix. Then path matching should pass.
I think it works. You might need to do some actions to prevent consumer from accessing /public directly in mruby if it is required.
from nghttpx-ingress-lb.
@tatsuhiro-t thanks for trying to help out. It seems any kind of mruby manipulation of the path ends up dictating later decision making of choosing the backend fail in my case. My line of thought would only work if mruby kicked in after backend was chosen.
In any case, I got this to work for my use-case:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: hmda-platform-ingress
spec:
rules:
- host: 'filing.myhmdaapp.com'
http:
paths:
- path: /
backend:
serviceName: hmda-platform-api
servicePort: filing
- host: 'admin.myhmdaapp.com'
http:
paths:
- path: /
backend:
serviceName: hmda-platform-api
servicePort: admin
- host: 'public.myhmdaapp.com'
http:
paths:
- path: /
backend:
serviceName: hmda-platform-api
servicePort: public
Then accessing whichever one using the correct Host
headers.
curl -H "Host: filing.myhmdaapp.com" -i http://ingress-address
Closing this issue for now.
from nghttpx-ingress-lb.
Related Issues (20)
- Permission denied error while running the container as a non root user HOT 2
- How to configure SSL Passthrough? HOT 1
- How if I only want to implement the HTTP3 on my nginx ingress ? HOT 1
- feature request: routing `type: ExternalName` services HOT 4
- Upgrade to nghttp2 v1.26.0 HOT 2
- Add PROXY protol support for frontend servers HOT 2
- ingress for grpc service HOT 2
- pls add ingress.zlab.co.jp/default-backend-config HOT 4
- request to add publish-service flag HOT 5
- redirect-if-not-tls in backend template HOT 2
- backendconfig API endpoint returned unsuccessful status code 413 HOT 5
- Don't depend on external "diff" command HOT 1
- Use debian-base-amd64 to reduce image size
- is it possible to watch several k8s namespaces? HOT 3
- how to debug the routing process HOT 10
- how load balancing works in nghttpx ingress HOT 9
- Does nghttpx ingress intercept errors? HOT 4
- Failed to start after changing the tls cert HOT 2
- support protocol H1 and H2 HOT 4
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 nghttpx-ingress-lb.