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?
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.
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 still have this but it’s only when having a complex route like {host}/{contextPath}/path1/path2
in this case the router calculates a wrong base using ./../../VAADIN/ .... min.js
forum renders 3 dots instead of 2 but they are 2x2 /2dots/2dots
I have this with 24.9.5
Minor correction, this happens when having a) contextPath b) complex path ending with /{params} for example /contextPath/dashboard/nl?viewType=x, having /nl triggers the issue.
My focus is fixing it now using reverse proxy, i’ll read referrer and reroute to the correct server.
I’ll focus on a minimal example soon after
Thank you! Please create a GitHub issue here: GitHub · Where software is built and add your example there; that way it’s not lost in the Forum noise.