vaadin / spring

Spring integration for Vaadin
https://vaadin.com/start
177 stars 101 forks source link

Connections over reverse proxy stopped working #30

Open mosi0815 opened 8 years ago

mosi0815 commented 8 years ago

We used 1.0.0beta2 of the vaadin-spring plugin. Everything works as expected. Vaadin talks to: http://cluster/path/UIDL/?v-uiId=0.

Starting with version 1.0.0beta3 it stopped working. The UI loads normally. On interaction Vaadin now tries to send requests to: http://cluster/vaadinServlet/UIDL/?v-uiId=0

I simplified our balancer (apache 2.4) configuration down to: ProxyPass /path/ ajp://server1:8050/

I also tried: ProxyPass /path/ http://server1:8080/

Same result.

If I connect directly to http://server1:8080/both versions work.

pleku commented 7 years ago

A tested workaround for this is to use

@SpringBootApplication(exclude = VaadinServletConfiguration.class)

And include the uploaded custom configuration file. (https://github.com/vaadin/spring/files/642305/CustomVaadinServletConfiguration.java.zip) This does not work however if you're application is on root context and you're mapping other paths under it like additional servlets, spring actuator stuff..

This should be fixed at some point, suggestion is to make VaadinServletConfiguration configurable with a deployment time parameter. The custom configuration could map all the Vaadin related paths separately instead of using /* so that any other paths work also.

mosi0815 commented 7 years ago

Any news regarding this bug?

phillipjohnson commented 7 years ago

What's the status of getting the workaround into a release?

cosmocracy commented 7 years ago

Update please, @pleku? Enterprise apps aren't possible currently with latest Vaadin 1.0.0 :-(

pleku commented 7 years ago

Sorry for not having a proper fix included for this, but the workaround works (I know enterprise apps that are using that in production).

I cannot unfortunately give any promise when we'll get to looking at a proper fix for this, we currently have other products in focus (CDI-addon and 8.2) for the 8-series. Earliest guesstimate would be late November or December.

cosmocracy commented 7 years ago

Thanks for your reply, @pleku. Sorry, I was imprecise. Vaadin not workable for those who host their enterprise apps on a platform like NGINX. As it stands I'd need one server for every app with this workaround, right? (Hoping there's some workaround better than that...will have to order LOTS of SSL certificates for each app otherwise.......)

pleku commented 7 years ago

I see. I think the only option then would be to not map any app to the root url to avoid "/*" caching all requests.

Now after refreshing my memory, I recall the fix might not be that big task actually (must be the optimist me talking). The same fix should be made for the Spring add-on for Vaadin Flow too (V10). I'll try to see if we can get squeeze the fix in for that since it is in active development and then port it to V8 version of the add-on too. But that would even yet happen earliest on November.

cosmocracy commented 7 years ago

@pleku Thank you for looking into this. I owe you a drink of your choosing! ;-)