Skip to content

URL with trailing "/" #1476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rsp92028 opened this issue Nov 17, 2024 · 3 comments · May be fixed by #1663
Open

URL with trailing "/" #1476

rsp92028 opened this issue Nov 17, 2024 · 3 comments · May be fixed by #1663
Labels
bug Something isn't working size:S - 2 Sizing estimation point

Comments

@rsp92028
Copy link

Current Behavior

"www.example.com/dashboard/mypage" works but "www.example.com/dashboard/mypage/" does not work.

When nginx is used as a reverse proxy, it adds a trailing "/" , I imagine that the trailing "/" could be an issue with other configurations.

Expected Behavior

Ignore trailing "/".

Steps To Reproduce

No response

Environment

  • Dashboard version: 1.19.1
  • Node-RED version: 4.0.5: Maintenance Release Editor
  • Node.js version:
  • npm version:
  • Platform/OS: Linux
  • Browser: FireFox 132.0.2 (64-bit)

Have you provided an initial effort estimate for this issue?

I can not provide an initial effort estimate

@rsp92028 rsp92028 added bug Something isn't working needs-triage Needs looking at to decide what to do labels Nov 17, 2024
@colinl
Copy link
Contributor

colinl commented Nov 17, 2024

You are right, even when accessing locally. The url
http://localhost:1880/dashboard/testpage
works but
http://localhost:1880/dashboard/testpage/
shows in the browser console:

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

manifest.webmanifest:1 Manifest: Line: 1, column: 1, Syntax error.

@joepavitt joepavitt moved this from Backlog to Up Next in Dashboard Backlog Nov 18, 2024
@joepavitt joepavitt added size:S - 2 Sizing estimation point and removed needs-triage Needs looking at to decide what to do labels Nov 18, 2024
@Bond246
Copy link

Bond246 commented Nov 22, 2024

Hello,
I'm struggeling with the same problem.

I try to "hide" the /dashboard/page-path to my users by using a traefik middleware that adds the path-prefix.
But it seems to that the addprefix-middleware of traefik always adds a trailing slash.

There was a discussion about but i think they didn't fixed that
traefik/traefik#5799

Using the stripprefix-middleware with "/" does nothing. Don't know how that should be handled.
Thanks!

@robertsLando
Copy link

robertsLando commented Nov 28, 2024

Got same error today when using Dahsboard behind an nginx reverse proxy.

location / {
        proxy_pass http://127.0.0.1:1880/dashboard/;
        proxy_set_header Host 127.0.0.1;
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection $connection_upgrade;
		proxy_set_header X-Forwarded-Proto $scheme;
		proxy_set_header Referer "";
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_cache_bypass $http_upgrade;
}

A trick that actually make it work is:

 location / {
                # redirect to /ui/
                return 301 /ui/;
        }

        location /ui/ {
			proxy_pass http://127.0.0.1:1880/dashboard/;
	        proxy_set_header Host 127.0.0.1;
			proxy_http_version 1.1;
			proxy_set_header Upgrade $http_upgrade;
			proxy_set_header Connection $connection_upgrade;
			proxy_set_header X-Forwarded-Proto $scheme;
			proxy_set_header Referer "";
			proxy_set_header X-Real-IP $remote_addr;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_cache_bypass $http_upgrade;
		}

@Steve-Mcl Steve-Mcl linked a pull request Apr 8, 2025 that will close this issue
10 tasks
@Steve-Mcl Steve-Mcl moved this from Up Next to Under Review in Dashboard Backlog Apr 8, 2025
@Steve-Mcl Steve-Mcl moved this to Review in 🛠 Development Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:S - 2 Sizing estimation point
Projects
Status: Under Review
Status: Review
Development

Successfully merging a pull request may close this issue.

5 participants