@uppy/tus http going to https

Hello i am soo lost and confused and this super urgent and i think i have read and searched everywhere but @uppy/tus keeps converting my https url to http, i read need to do some reverse proxy but not sure how i send files with this route “/api/auth/upload/files” and i am hosting my project with docker + portainer + nginx proxy manager, so if i need to edit my nginx what do i write ? Thanks.

What tus server are you using? If you use tusd, then please consult Configuration | tusd documentation for information about how to configure proxies.

I am using
import { Server } from “@tus/server”;
import { FileStore } from “@tus/file-store”;

in there documentation says there is this example, my docker runs on port 5000, do i just add that to the nginx with port 5000 ?

location / {
        # Forward incoming requests to local tusd instance
        proxy_pass http://localhost:8080;

        # Disable request and response buffering
        proxy_request_buffering  off;
        proxy_buffering          off;
        proxy_http_version       1.1;

        # Add X-Forwarded-* headers
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_set_header         Upgrade $http_upgrade;
        proxy_set_header         Connection "upgrade";
        client_max_body_size     0;
    }```

You should set

proxy_pass http://localhost:5000;

and then put it with the other configuration options into wherever you configure nginx.

Getting this when uploading with production url

Mixed Content: The page at 'https://chappie.app/cloud/user/my-drive/665f8784e5818ea2fc809c8e' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://chappie.app/api/auth/upload/files/8cdbe3ebf24935c85c88e39f59f82585'. This request has been blocked; the content must be served over HTTPS.

added this to the Custom Nginx Configuration

location /api/auth/upload/files {
        # Forward incoming requests to local tus instance
        proxy_pass http://localhost:5000; # tried with proxy_pass http://mypublicip:5000;

        # Disable request and response buffering
        proxy_request_buffering off;
        proxy_buffering off;
        proxy_http_version 1.1;

        # Add X-Forwarded-* headers
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        client_max_body_size 0;
}

i am selfhosting and not fully good with nginx yet so just using own selfhosted https://nginxproxymanager.com

Did you enable respectForwardedHeaders as mentioned in tus-node-server/packages/server at main · tus/tus-node-server · GitHub?

1 Like

Thanks soooo much it worked and if anyone using self hosted https://nginxproxymanager.com use ur public ip with port not localhost or will be failing.

Thanks now i can update clients :joy: :100:

1 Like