Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note about port of X-Forwarded-Host to nginx.conf example #1190

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Chaoses-Ib
Copy link

tusd will use X-Forwarded-Host as the host if -behind-proxy is enabled. However, the example Nginx config doesn't put the port number into X-Forwarded-Host, but only the address. This makes the URL returned by tusd to be on port 80/443 instead of what Nginx is actually listening on.

Changing proxy_set_header X-Forwarded-Host $host to proxy_set_header X-Forwarded-Host $host:$server_port can fix this problem. But this leads to the occurrence of :80/:443 in the returned URL even the client doesn't put :80/:443 in the Host header, which can be a little weird. So I just add a comment about this.

Related issue: #136

@Acconut
Copy link
Member

Acconut commented Sep 19, 2024

Thanks for the PR! We can also consider adding a logic in tusd's URL generation to drop the default ports for HTTP(S) if they are used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants