Spring Boot Vaadin Flow Non-Default Context Root Issue

I followed this guide [here]
to configure a non-default context root for the Vaadin application. So, instead of

the application now serves at


After making this change, I realized that not all the resources are served under mycontext; some are still served at the root. i.e. http://localhost:8080/VAADIN/static/client/client-...alphanumericsequence....cache.js

Since my application is behind a reverse proxy and the proxy is only allowing content through the “mycontext” path, I have to put in a special rewrite rule just for the “/VAADIN” path, which I would rather avoid.

Is there a way to configure the Vaadin application so that the other resources (i.e. /VAADIN) can be served under the “mycontext” context root?

Hi Kevin,

I use root locally and deploy both as root and in a context and do not have any problems (14.1.27). What is the resources you are referring to and can you post an example? Also do you use spring by any chance?

I’m using Spring Boot and the article I referenced explains how to set up an alternate context root when using Spring Boot.
So far, I can only see one resource that is being served at root (http://localhost:8080/VAADIN/static/client/client-...alphanumericsequence....cache.js).
It’s possible that I changed something in my project since I originally created it that is causing this condition but to be sure I’ll test it on a new project and reply with my findings. I’m using Vaadin 14.1.28.

So, I had some time to test this out today with a brand new project (Vaadin 15.0.6) I created in Eclipse and I confirmed that there is something different with my main project; the brand new project, configured with Spring Boot and an alternate context root, only serves resources out of the context root while my main project serves 1 resource out of the root and the rest of the resources out of the context root.

Main project: removed URL
I tried to attach my new Eclipse project as an archive but this forum post wouldn’t accept it. You’ll have to make your own using the instructions in previous posts to see the results.

I open up dev tools in Chrome and see the 1 resource that is being served out of the root:
removed URL

In the new project, that same “client” prefix isn’t in any of the resources. Rather, they’re all like vaadin-1-… vaadin-0-… vaadin-2-… vaadin-3-…

Then, I tried to change the new project to match the Vaadin version of my main project by updating the version in the pom.xml to 14.1.28. After rebuilding and deploying the new project, I saw that the new project ALSO serves 1 resource out of the root with the same format as what I found in my main project: http://localhost:8080/VAADIN/static/client/client-C4F9B966016EDC8B1F7B7E1211C8B1A7.cache.js

So, that means I didn’t change something in my main project that is fundamentally different than a new Vaadin 14 project.

But, that doesn’t explain why Martin is seeing different results than me.

Any ideas anyone?

I don’t have my configuration near me, but I am 99.9% sure that I don’t set vaadin.Urlmapping. Running in root context locally and deployed in non-root context on test server and root context on production as WAR file.

So, I tried removing the vaadin.urlMapping setting so that my application is again serving out of the root. Then, I put the application behind the reverse proxy under the path name I originally wanted for the context root and I no longer have the problem of the application trying to serve any resources out of the root of my reverse proxy.

I think the [guide]
(https://vaadin.com/docs/v14/flow/spring/tutorial-spring-configuration.html) I referenced earlier is misleading when it’s implemented with a reverse proxy.

Anyway, I think I’ve got this resolved.

Thanks for the replies and helping me get this sorted out.

If you can articulate the issue in the documentation, you should file a ticket:https://github.com/vaadin/flow-and-components-documentation/issues/new

Olli Tietäväinen:
If you can articulate the issue in the documentation, you should file a ticket:https://github.com/vaadin/flow-and-components-documentation/issues/new