Reverse proxy: support X-Forwarded-Port, or allow some sort of --proxy-port #249

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

Originally created by @zmwangx on GitHub.

I'm hosting transfer.sh on a certain server where unfortunately port 443 is off limits, so I'm exposing the service on port 8443 instead. I'm using nginx as a reverse proxy in front of the transfer.sh server, where the configuration includes

        proxy_set_header   Host                 $host;
        # ...
        proxy_set_header   X-Forwarded-Port     8443;

The server doesn't support the X-Forwarded-Port header though, so unfortunately all URLs I get don't have the port attached. Is it possible to add support for the header, or maybe add some server option so that a non-default port could be used? Thanks.

Originally created by @zmwangx on GitHub. I'm hosting transfer.sh on a certain server where unfortunately port 443 is off limits, so I'm exposing the service on port 8443 instead. I'm using nginx as a reverse proxy in front of the transfer.sh server, where the configuration includes ```nginx proxy_set_header Host $host; # ... proxy_set_header X-Forwarded-Port 8443; ``` The server doesn't support the `X-Forwarded-Port` header though, so unfortunately all URLs I get don't have the port attached. Is it possible to add support for the header, or maybe add some server option so that a non-default port could be used? Thanks.
Author
Owner

@paolafrancesca commented on GitHub:

@zmwangx, putting the proxy port in the Host header is enough:

        proxy_set_header   Host                 $host:8443;
@paolafrancesca commented on GitHub: @zmwangx, putting the proxy port in the `Host` header is enough: ```nginx proxy_set_header Host $host:8443; ```
Author
Owner

@zmwangx commented on GitHub:

Didn't think of that... Thanks.

@zmwangx commented on GitHub: Didn't think of that... Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#249