nginx-basic-auth-proxy icon indicating copy to clipboard operation
nginx-basic-auth-proxy copied to clipboard

Chunked encoding - can't attach docker

Open aienabled opened this issue 7 years ago • 2 comments

Hello! This proxy works really great and allows me to protect Docker API with basic auth. However, when I need to attach to the Docker container, the response from Nginx has header "Transfer-Encoding: chunked" and so .NET Docker client (not sure about other clients) cannot establish connection as this is not a raw stream connection.

It's easy to test with curl:

curl -i -X POST http://LOGIN:PASS@URL/containers/{CONTAINERID}/attach

If I connect directly to the Docker API the response headers are:

Content-Type: application/vnd.docker.raw-stream

But with Nginx proxy the response headers are:

Content-Type: application/vnd.docker.raw-stream
Transfer-Encoding: chunked
Connection: keep-alive

Regards!

aienabled avatar Jan 11 '18 06:01 aienabled

Disabling chunked encoding in the Nginx configuration simply closes connection so this is not a solution. Alas, I have no experience with Nginx and don't know how to configure it to proxy raw streams.

aienabled avatar Jan 11 '18 07:01 aienabled

Did you ever figure this out? I'm stuck with same problem

mehulmpt avatar Feb 13 '20 10:02 mehulmpt