These are chat archives for spring-cloud/spring-cloud

30th
Oct 2016
Ali Akbar Azizkhani
@removed~azizkhani
Oct 30 2016 17:06
Hi All, I have project that config zuul for reverse proxy .my config like this
zuul:
  routes:
    app:
      path: /app/**
      url: http://localhost:8082/app
server:
    compression:
        enabled: true
    port: 9090
after i call localhost:9090/app .request redirect to http://localhost:8082/app
why redirect request ?
Spencer Gibb
@spencergibb
Oct 30 2016 17:13
Zuul doesn't send redirects, your app is sending the redirect
Ali Akbar Azizkhani
@removed~azizkhani
Oct 30 2016 17:14
@spencergibb my application is very simple
just some html static page
and my application.yml is that i send abow
i dont have security config in my app
Marcos Barbero
@marcosbarbero
Oct 30 2016 17:16
I can be wrong but your configuration is telling the application to redirect
Spencer Gibb
@spencergibb
Oct 30 2016 17:17
It may have to do with the trailing slash, but zuul doesn't send redirects on its own.
Ali Akbar Azizkhani
@removed~azizkhani
Oct 30 2016 17:21
which part of my configuration is wrong?
Marcos Barbero
@marcosbarbero
Oct 30 2016 17:25
It's not wrong it is just telling to route the requests from 9090/app to 8082/app
Ali Akbar Azizkhani
@removed~azizkhani
Oct 30 2016 17:29
@marcosbarbero ok. why redirect to http://localhost:8082/app instead show content in localhost:9090/app
Marcos Barbero
@marcosbarbero
Oct 30 2016 17:31
I think I got your pain. It's not keeping the URL but also redirecting to the target app URL. Is it?
Dave Syer
@dsyer
Oct 30 2016 17:33
It's the container (e.g. Tomcat)
You just have to make sure you add the trailing slash
Or customize the container
Ali Akbar Azizkhani
@removed~azizkhani
Oct 30 2016 17:43
@dsyer i change http://localhost:8082/app ro http://localhost:8082/app/ and work correct .thanks
Ali Akbar Azizkhani
@removed~azizkhani
Oct 30 2016 18:00
@dsyer my second app have spring security formLogin .after login success again i get unauthorize
i think sessionid in cookie not share between two apps
Dave Syer
@dsyer
Oct 30 2016 18:52
You want to share a session between two apps?
I don't necessarily think that's a good idea, but you can see how to do it in the angular-security tutorial on spring.io
Ali Akbar Azizkhani
@removed~azizkhani
Oct 30 2016 18:53
No i dont need
Yes i see all post
Is x-forward is solution for this problem?
My zuul app is a landing page and just show static content and route admin app
My landing app dose not security
Dave Syer
@dsyer
Oct 30 2016 19:02
I don't follow that sorry
If you only have security on one app, then that's the one that has to have the session right?
If not, then you will have a hard time customizing your session handling
Ali Akbar Azizkhani
@removed~azizkhani
Oct 30 2016 19:04
I have app a that route to app b ( spring security form login)
After login
Dave Syer
@dsyer
Oct 30 2016 19:05
So app a is a Zuul gateway?
Ali Akbar Azizkhani
@removed~azizkhani
Oct 30 2016 19:05
When i send request to url
Yes app a is a zuul
After login when i call request by ajax
I get unauthorize
Dave Syer
@dsyer
Oct 30 2016 19:06
So you need the cookie to be passed back to the back end
Ali Akbar Azizkhani
@removed~azizkhani
Oct 30 2016 19:06
I see cookie in chrome
Thay cookie url is for app a
Dave Syer
@dsyer
Oct 30 2016 19:06
Zuul won't send cookies to the backend unless you specifically ask it
App a doesn't need cookies right?
Ali Akbar Azizkhani
@removed~azizkhani
Oct 30 2016 19:07
Yes app a dose not need
Dave Syer
@dsyer
Oct 30 2016 19:07
It just needs to pass the headers to the backend
So you need to set "sensitive" headers for that route
It's in the user guide
Ali Akbar Azizkhani
@removed~azizkhani
Oct 30 2016 19:08
Pass cookie to backend?
How ?
Zuul user guide or boot?
And how ignore app A cookie ?
Will write custom filter in zuul?
Dave Syer
@dsyer
Oct 30 2016 19:19
Spring Cloud has features for passing cookies. This is the spring-cloud gitter channel
So that's the user guide
Ali Akbar Azizkhani
@removed~azizkhani
Oct 30 2016 19:24
Thanks 😔