How to self host the server behind proxy #127

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

Originally created by @hkpanchani on GitHub.

How to build a production binary and make a linux service and host it behind proxy with SSL termination

Originally created by @hkpanchani on GitHub. How to build a production binary and make a linux service and host it behind proxy with SSL termination
Author
Owner

@hkpanchani commented on GitHub:

Yes perfectly fine. Good to close this one ouy.

@hkpanchani commented on GitHub: Yes perfectly fine. Good to close this one ouy.
Author
Owner

@paolafrancesca commented on GitHub:

@hkpanchani
you don't need to build the binary btw, you can use the one available on release page: https://github.com/dutchcoders/transfer.sh/releases
(look under Assets)

Setting the proxy depends on what you use as proxy, here's a sample conf for nginx:

server {
  listen 443 ssl;
  server_name domain.tld;

  access_log /var/log/nginx/domain.tld;
  error_log /var/log/nginx/domain.tld;

  ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;

  client_max_body_size 20000M;

  location / {
    proxy_request_buffering off;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_pass https://127.0.0.1:8443/;
  }
}

You have to change the paths and domain.tld and eventually the port of the upstream in proxy_pass

client_max_body_size should be set to the same value of max-upload-size on transfer.sh

@paolafrancesca commented on GitHub: @hkpanchani you don't need to build the binary btw, you can use the one available on release page: https://github.com/dutchcoders/transfer.sh/releases (look under `Assets`) Setting the proxy depends on what you use as proxy, here's a sample conf for nginx: ``` server { listen 443 ssl; server_name domain.tld; access_log /var/log/nginx/domain.tld; error_log /var/log/nginx/domain.tld; ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem; client_max_body_size 20000M; location / { proxy_request_buffering off; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_pass https://127.0.0.1:8443/; } } ``` You have to change the paths and `domain.tld` and eventually the port of the upstream in `proxy_pass` `client_max_body_size` should be set to the same value of `max-upload-size` on transfer.sh
Author
Owner

@stefanbenten commented on GitHub:

@hkpanchani Is there anything left to do on this issue? Are we good to close this?

@stefanbenten commented on GitHub: @hkpanchani Is there anything left to do on this issue? Are we good to close this?
Author
Owner

@stefanbenten commented on GitHub:

Hello @hkpanchani ,

to build a production binary the easiest i found is

git fetch -t // Fetch all tags
git checkout v1.3.1 // Latest Release here of course
go install ./... // Build actual binary

In order to run it behind a proxy/loadbalancer, you can run it with --listener 127.0.0.1:8080 and then hook your proxy up to this URL. This should be pretty much it.

@stefanbenten commented on GitHub: Hello @hkpanchani , to build a production binary the easiest i found is ``` git fetch -t // Fetch all tags git checkout v1.3.1 // Latest Release here of course go install ./... // Build actual binary ``` In order to run it behind a proxy/loadbalancer, you can run it with `--listener 127.0.0.1:8080` and then hook your proxy up to this URL. This should be pretty much it.
Author
Owner

@stefanbenten commented on GitHub:

Technically you are still missing the ldflags as done here, but it should not matter for operation:
cff0a88bf3/.github/workflows/release.yml (L118)

@stefanbenten commented on GitHub: Technically you are still missing the ldflags as done here, but it should not matter for operation: https://github.com/dutchcoders/transfer.sh/blob/cff0a88bf3d90f4de654dcdb1157ce0b2bccf02c/.github/workflows/release.yml#L118
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#127