Connection dropped while running unicorn inside container

I’ve got a container that is running unicorn (ruby webserver) serving a sinatra app.
One of the javascript files doesn’t get loaded because while downloading it, the connection is dropped. This script is around 500KB.
When the connection is dropped chrome doesn’t load the script because the content size is mismatched.

This only happens when the request comes from a computer that is not the docker host.
Running the app outside of docker, everything works fine, local requests work and also the remote ones.

I believe there is some bug that drops the connection.

As a temporary fix, I’ve done a ssh port forwarding “ssh -L 0.0.0.0:3000:127.0.0.1:3001 -N 127.0.0.1”.