tusd icon indicating copy to clipboard operation
tusd copied to clipboard

Traefik HTTP redirection

Open angelosnm opened this issue 2 years ago • 7 comments

I have installed tus via helm in a bare metal kuberntes cluster and I have created an ingress route TLS terminated and I can access it via HTTPS. Although, I've tested the upload process and when a client uploads a file in the Pod logs the request is being sent as HTTP.

[tusd] 2022/06/23 11:52:59 event="UploadCreated" id="2d9f1162d084d41842af83a7778da198" size="10051" url="http://tus-eia.scio.services:18102/files/2d9f1162d084d41842af83a7778da198" [tusd] 2022/06/23 11:52:59 event="ResponseOutgoing" status="201" method="POST" path="" requestId=""

The client also returns a 404 error as indeed the HTTP route does not exist.

raise TusCommunicationError(msg, resp.status_code, resp.content) tusclient.exceptions.TusCommunicationError: Attempt to retrieve offset fails with status 404

angelosnm avatar Jun 23 '22 12:06 angelosnm

Same behaviour occurs also using ingress-nginx controller (using both the embeded one in the values.yml and an external one)

angelosnm avatar Jun 23 '22 12:06 angelosnm

Did you setup your proxy and tusd according to https://github.com/tus/tusd/blob/master/docs/faq.md#can-i-run-tusd-behind-a-reverse-proxy?

Acconut avatar Jun 27 '22 12:06 Acconut

@Acconut To my understanding according to the above guide the first thing that needs to be done is to pass -behind-proxy flag in the values.yml. Is that correct?

angelosnm avatar Jun 28 '22 07:06 angelosnm

Setting -behind-proxy is necessary, but not enough. Just must also configure the proxy to set the X-Forwarded-* headers, as mentioned in the guide.

Acconut avatar Jun 28 '22 09:06 Acconut

Cool! how this flag can be passed in the values.yml file?

angelosnm avatar Jun 28 '22 09:06 angelosnm

I don´t know, unfortunately. I am not a Kubernetes user. You will have to try it out on your own.

Acconut avatar Jun 28 '22 09:06 Acconut

After doing these be sure to clear your browser's local storage otherwise it's gonna keep going to a bad endpoint if it changed at all

G2G2G2G avatar Aug 07 '22 07:08 G2G2G2G