Skip to content

Resolve "S3 nginx proxy/redirect"

Agate requested to merge 932-nginx-proxy into develop

Closes #932 (closed)

This was affecting DSub (and possibly other subsonic clients that send an Authorization header) when using Minio or S3.

cc @xorander00 and @Sporiff

Side note on the debugging:

Symptoms: DSub wasn't streaming audio when using Minio/S3 as a storage backend on Funkwhale. Other Subsonic clients worked fine.

Solution:

  1. Spend 30m to reproduce the issue (setup minio locally, upload some files, configure DSub, etc.)
  2. Observe that Minio returns a 400 error
  3. Spend 1h trying to find out how to output the response body (which is likely to contain the actual error)
  4. Dive into Nginx and Lua scripting to output the response body from Minio to nginx logs (https://serverfault.com/questions/361556/is-it-possible-to-log-the-response-data-in-nginx-access-log)
  5. See that Minio complains about incorrect authentication
  6. See that DSub send an Authorization header that is forwarded to Minio, but has nothing to do with Minio
  7. Ensure the header is stripped by Nginx

It was fun :p

Edited by Agate

Merge request reports