404 on assets in subpath #309

Closed
opened 2026-01-19 18:29:50 +00:00 by michael · 2 comments
Owner

Originally created by @gncabrera on GitHub.

Hi,
we've been using transfer.sh through the Dockerfile for a long time behind an Nginx reverse proxy (transfer.mydomain.com). But because of some architecture changes we have to migrate to a subpath of the domain (mydomain.com/transfer).
The problem is that when loading the webpage, all assets are throwing a 404 Not found. This is because the webpage is trying to load the assets with the root path (mydomain.com/styles/main.css).

Is there a way to configure a base path for the assets when running the webapp (preferably with docker) they can be called like mydomain.com/BASEPATH/styles/main.css?

Thank you very much!

Originally created by @gncabrera on GitHub. Hi, we've been using transfer.sh through the Dockerfile for a long time behind an Nginx reverse proxy (transfer.mydomain.com). But because of some architecture changes we have to migrate to a subpath of the domain (mydomain.com/transfer). The problem is that when loading the webpage, all assets are throwing a **404 Not found**. This is because the webpage is trying to load the assets with the root path (mydomain.com/styles/main.css). Is there a way to configure a base path for the assets when running the webapp (preferably with docker) they can be called like **mydomain.com/BASEPATH/styles/main.css**? Thank you very much!
Author
Owner

@gncabrera commented on GitHub:

Oh, thank you. You're right, I will be tweaking the nginx for a rewrite

@gncabrera commented on GitHub: Oh, thank you. You're right, I will be tweaking the nginx for a rewrite
Author
Owner

@paolafrancesca commented on GitHub:

@gncabrera do you use your web-path or the bundled github.com/dutchcoders/transfer.sh-web?
You should be able to fix at nginx level with a rewrite rule for the assets checking that the referer is mydomain.com/transfer. I've some concern on handling this problem in the transfer.sh-web repository.

Or you can clone github.com/dutchcoders/transfer.sh-web, change the src for the assets and follow the instruction to use it in your transfer.sh instance

@paolafrancesca commented on GitHub: @gncabrera do you use your `web-path` or the bundled github.com/dutchcoders/transfer.sh-web? You should be able to fix at nginx level with a rewrite rule for the assets checking that the referer is `mydomain.com/transfer`. I've some concern on handling this problem in the transfer.sh-web repository. Or you can clone github.com/dutchcoders/transfer.sh-web, change the src for the assets and follow the instruction to use it in your transfer.sh instance
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#309