0

I'm hosting Supabase with Kong and using TUS for resumable file uploads. My goal is to ensure that all client-side requests consistently start with https://myhost.com/storage/v1/..., and have Kong handle routing to the correct storage service endpoint without modifying the origin URL across subsequent requests.

My Setup:

  • I have a Coolify server that is running my Supabase with Kong.

  • The initial request to https://myhost.com/storage/v1/upload/resumable routes correctly to the Supabase storage service, and Kong successfully forwards it.

  • However, the second request changes the origin to https://myhost.com:8000/upload/resumable/<token>,

My client uppy config:

const supabaseUploadURL = `${process.env.NEXT_PUBLIC_SUPABASE_URL}/storage/v1/upload/resumable`;
const upp = new Uppy({
      restrictions:{
        allowedFileTypes: ['.pdf', 'application/pdf'],
      }
    })
      .use(Tus, {
        endpoint: supabaseUploadURL,
        headers: {
          authorization: `Bearer ${session.user.supabase_token}`,
        },
        chunkSize: 6 * 1024 * 1024,
        allowedMetaFields: ["bucketName", "objectName", "contentType", "cacheControl"],
      });

=> docker compose of the supabase on coolify is the default one

I tried hosting supabase outside of coolify by using nginx but same issue.

1 Answer 1

1

Look at this issue on Supabase Github, it seems relevant to your case.
https://github.com/supabase/storage/issues/538

In my case (Supabase self hosting with Docker Compose on MacOS), I fixed it by adding this to the Kong service:

KONG_PORT_MAPS: "443:8000"

And this to the storage service:

REQUEST_ALLOW_X_FORWARDED_PATH: "true"
NODE_ENV: production
FILE_SIZE_LIMIT: 52428800000

Beware of cache if your testing on Chrome!

Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.