Question: Passing an argument to docker to set the return URL #242

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

Originally created by @sean-perryman on GitHub.

Apologies if this is the wrong place to post this.

As I am starting to need to pass around more sensitive information, and am learning Docker, I decided to try and roll my own copy of transfer.sh. It is working great with Nginx as the SSL front end, but I cannot seem to figure out how to get the transfer.sh server to recognize the external URL. Is there a setting or something I can set to perform this task? I am just using the Docker command you have listed on the Github page, but perhaps its something I can do in a Dockerfile?

Current output:

$ transfer testfile
######################################################################## 100.0%
http://127.0.0.1:8080/123jaT/testfile

Instead of the desired:

$ transfer testfile
######################################################################## 100.0%
https://external.url/123jaT/testfile
Originally created by @sean-perryman on GitHub. Apologies if this is the wrong place to post this. As I am starting to need to pass around more sensitive information, and am learning Docker, I decided to try and roll my own copy of transfer.sh. It is working great with Nginx as the SSL front end, but I cannot seem to figure out how to get the transfer.sh server to recognize the external URL. Is there a setting or something I can set to perform this task? I am just using the Docker command you have listed on the Github page, but perhaps its something I can do in a Dockerfile? Current output: ``` $ transfer testfile ######################################################################## 100.0% http://127.0.0.1:8080/123jaT/testfile ``` Instead of the desired: ``` $ transfer testfile ######################################################################## 100.0% https://external.url/123jaT/testfile ```
Author
Owner

@sean-perryman commented on GitHub:

Awesome! That was exactly what I needed. I just popped that in right under the proxy_pass directive in my nginx.conf and it worked perfect. Thanks!

@sean-perryman commented on GitHub: Awesome! That was exactly what I needed. I just popped that in right under the proxy_pass directive in my nginx.conf and it worked perfect. Thanks!
Author
Owner

@sean-perryman commented on GitHub:

That was my original thought, but it seems the docker container is setting that for itself. For example, browsing the tld https://example.url shows up at the top (where it would normally say example.url) http://127.0.0.1:8080/

Perhaps there is a way I can fake that URL when I start the container or something?

@sean-perryman commented on GitHub: That was my original thought, but it seems the docker container is setting that for itself. For example, browsing the tld https://example.url shows up at the top (where it would normally say example.url) http://127.0.0.1:8080/ Perhaps there is a way I can fake that URL when I start the container or something?
Author
Owner

@paolafrancesca commented on GitHub:

@sean-perryman you mentioned Nginx, that I presume you use as proxy to the transfer service in the docker container.
In this case you have to add in the Nginx configuration the following:

proxy_set_header   Host                 $host;
@paolafrancesca commented on GitHub: @sean-perryman you mentioned Nginx, that I presume you use as proxy to the transfer service in the docker container. In this case you have to add in the Nginx configuration the following: ``` proxy_set_header Host $host; ```
Author
Owner

@dopessoa commented on GitHub:

This isn't really related to the Dockerfile.

Please take a look at your transfer function/alias, the URL should be pointing to https://external.url and not http://127.0.0.1:8080.

@dopessoa commented on GitHub: This isn't really related to the Dockerfile. Please take a look at your transfer function/alias, the URL should be pointing to https://external.url and not http://127.0.0.1:8080.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#242