-
Notifications
You must be signed in to change notification settings - Fork 30
Routing to wrong back end #30
Comments
Hi, Haven't had a chance to repro this first but my suspicion is that this is because your using a "modifier" not a "matcher".
Can you give it a try and let us know? |
Have tried all of the matcher rules, in all cases it is attempting to forward to the other service. Below is the rule set to time="2018-01-26T17:29:21Z" level=debug msg="vulcand/oxy/roundrobin/rebalancer: begin ServeHttp on request" Request="{"Method":"GET","URL":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/Web","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Proto":"HTTP/1.1","ProtoMajor":1,"ProtoMinor":1,"Header":{"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8"],"Accept-Encoding":["gzip, deflate"],"Accept-Language":["en-US,en;q=0.9"],"Connection":["keep-alive"],"Upgrade-Insecure-Requests":["1"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36"]},"ContentLength":0,"TransferEncoding":null,"Host":"andyndev2016","Form":null,"PostForm":null,"MultipartForm":null,"Trailer":null,"RemoteAddr":"10.1.1.4:53058","RequestURI":"/Web","TLS":null}" |
@AndyWNorris - Just clarify what you're trying to achieve: I couldn't reproduce your issue - but if I have understood your intent correctly - I have verified the setup below works: MVC App
Web API
If this is not the scenario you are trying to satisfy could you please clarify what your intention is. |
Hi Joni, Many thanks for your help. Andy |
No worries :) - closing issue. |
I have a Service Fabric Application consisting of two services that I am trying to route with using Traefik
One is an MVC app that provides a UI and the other a Web API.
Extensions for the MVC is set up as below from service manifest.
<StatelessServiceType ServiceTypeName="TodoWebType" UseImplicitHost="true" > <Extensions> <Extension Name="Traefik"> <Labels xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema"> <Label Key="traefik.frontend.rule.Web">ReplacePathRegex: /web /</Label> <Label Key="traefik.expose">true</Label> <Label Key="traefik.frontend.passHostHeader">true</Label> </Labels> </Extension> </Extensions> </StatelessServiceType>
For the API:
<StatelessServiceType ServiceTypeName="TodoApiType" UseImplicitHost="true" > <Extensions> <Extension Name="Traefik"> <Labels xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema"> <Label Key="traefik.frontend.rule.example">ReplacePathRegex: /api/index /api/Todo</Label> <Label Key="traefik.expose">true</Label> <Label Key="traefik.frontend.passHostHeader">true</Label> </Labels> </Extension> </Extensions> </StatelessServiceType>
When deployed the portal shows each rule associated with the correct back end.
At run time, the API request is correctly routed and generates the following entry in the Traefik debug log:
10.1.1.4 - - [26/Jan/2018:12:08:28 +0000] "GET /api/index HTTP/1.1" 200 344 - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36" 113 "fabric:/TodoApp/TodoApi" "http://AndyNDev2016:8081/" 96ms
The MVC one fails with the following log
10.1.1.4 - - [26/Jan/2018:11:56:01 +0000] "GET /web HTTP/1.1" 404 0 - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36" 100 "fabric:/TodoApp/TodoApi" "http://AndyNDev2016:8081/" 3ms
It appears that the wrong back end has been selected. Is this a configuration issue or a bug?
The text was updated successfully, but these errors were encountered: