Resolve "S3 nginx proxy/redirect"
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:
- Spend 30m to reproduce the issue (setup minio locally, upload some files, configure DSub, etc.)
- Observe that Minio returns a 400 error
- Spend 1h trying to find out how to output the response body (which is likely to contain the actual error)
- 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)
- See that Minio complains about incorrect authentication
- See that DSub send an Authorization header that is forwarded to Minio, but has nothing to do with Minio
- Ensure the header is stripped by Nginx
It was fun :p
Edited by Agate