How to change the protocol in "Sample use cases" #75

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

Originally created by @i207M on GitHub.

Hi, thanks for the great app.
I deployed it on my server behind Nginx, but I found that the default protocol in "Sample use cases" is http. How can I change it to https?

# Uploading is easy using curl
$ curl --upload-file ./hello.txt http://example.com/hello.txt
http://example.com/JnGvbixCV0/hello.txt

BTW, I don't want the app handling HTTPS certs, so Nginx is a must.
Thanks in advance.

Originally created by @i207M on GitHub. Hi, thanks for the great app. I deployed it on my server behind Nginx, but I found that the default protocol in "Sample use cases" is `http`. How can I change it to `https`? ``` # Uploading is easy using curl $ curl --upload-file ./hello.txt http://example.com/hello.txt http://example.com/JnGvbixCV0/hello.txt ``` BTW, I don't want the app handling HTTPS certs, so Nginx is a must. Thanks in advance.
Author
Owner

@i207M commented on GitHub:

Thanks for your help.

After some digging, the underlying issue is, user --https--> nginx --http--> transfer.sh, so the backend receives request in http protocol. And the way to indicate it to use https is to add this line to nginx config:

proxy_set_header X-Forwarded-Proto https;

Now the scheme of the web address is https.

@i207M commented on GitHub: Thanks for your help. After some digging, the underlying issue is, user --https--> nginx --http--> transfer.sh, so the backend receives request in http protocol. And the way to indicate it to use https is to add this line to nginx config: ``` proxy_set_header X-Forwarded-Proto https; ``` Now the scheme of the web address is https.
Author
Owner

@paolafrancesca commented on GitHub:

@i207M what do you mean exaclty with "how can I change it to http"? do you mean on the frontend?

the address is built with https://github.com/dutchcoders/transfer.sh/blob/main/server/handlers.go#L740 and used in the frontend https://github.com/dutchcoders/transfer.sh-web/blob/master/src/index.html#L46

if you make a plain http request, it will show http, if you make an https one it will show https

you can use nginx and letsencrypt to have nginx managing https and proxy to the app in plain http
see a sample config here: https://github.com/dutchcoders/transfer.sh/issues/458#issuecomment-1008632316

@paolafrancesca commented on GitHub: @i207M what do you mean exaclty with "how can I change it to http"? do you mean on the frontend? the address is built with https://github.com/dutchcoders/transfer.sh/blob/main/server/handlers.go#L740 and used in the frontend https://github.com/dutchcoders/transfer.sh-web/blob/master/src/index.html#L46 if you make a plain `http` request, it will show `http`, if you make an `https` one it will show `https` you can use nginx and letsencrypt to have nginx managing `https` and proxy to the app in plain `http` see a sample config here: https://github.com/dutchcoders/transfer.sh/issues/458#issuecomment-1008632316
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#75