Tornado Stream Error

I think you should give more context and if possible a reproducible copy/pastable example.
When you say that you are using nginx, does it mean that your code works on your local machine but not when deployed?