mvysny / shepherd

Build & run apps automatically
1 stars 0 forks source link

vaadin-boot-example-gradle doesn't work without trailing slash in the URL #2

Closed mvysny closed 1 year ago

mvysny commented 1 year ago
mvysny commented 1 year ago

Network traffic from app with the trailing slash:

Screenshot from 2023-02-05 08-02-29

Network traffic from app without the trailing slash:

image

mvysny commented 1 year ago

The problem is that in the latter case, the request for indexhtml.js goes to http://localhost/VAADIN/build/indexhtml.2ae6b87b.js while it should go to http://localhost/vaadin-boot-example-gradle/VAADIN/build/indexhtml.2ae6b87b.js

mvysny commented 1 year ago

Easiest workaround is to redirect to the URL with the trailing /

mvysny commented 1 year ago

Upstream ticket: https://github.com/vaadin/flow/issues/15399

mvysny commented 1 year ago

The problem is that the index.html file links to vaadin js bootstrap via ./VAADIN/ relative URL which resolves to http://localhost/VAADIN/build/indexhtml.2ae6b87b.js when the request URL is http://localhost/vaadin-boot-example-gradle (no trailing slash).

Possible solutions:

  1. Vaadin redirects to url with trailing slash
  2. The relative URL is generated in a different way when the url doesn't end with slash.
  3. Something else :)
  4. Modify reverse proxy to perform the redirect
mvysny commented 1 year ago

Workaround is to add a reverse-proxy rule which redirects to a path ending with a slash /: https://github.com/kubernetes/ingress-nginx/issues/646#issuecomment-396030010