Nginx splitting one single request's into multiple requests to upstream. (version 1.13.3)
mdounin at mdounin.ru
Wed Oct 4 16:04:56 UTC 2017
On Wed, Oct 04, 2017 at 11:29:23AM -0400, pankaj at releasemanager.in wrote:
> Basically, i am receiving a complete json doc as a chunk from one app server
> which is then proxied to another app which is handing each chunk as a
> complete request. The problem is when you put nginx in between the document
> is sometime divided in multiple chunks or multiple chunks are merge into one
> chunk and transmitted to upstream app server.
> I have tried various configuration options but couldn't identify which
> configuration exactly controls this rechunking while proxying or max size of
> the chunk so there's never a case when two json docs are sent to the app in
> a single chunk. Ideally it should sent the chunk as is to upstream as
By saying "chunk" you mean HTTP chunk, as in chunked transfer
If yes, you have to basic options:
- rewrite your app to don't do that. Transfer encodings are
specific to a particular connection, and intermediate HTTP
proxies are free to recode message bodies. And there is no way to
avoid this in nginx when using http proxying.
- re-think your proxing configuration to avoid HTTP proxies
between apps in question. For example, TCP proxying as
available in nginx stream module should work fine.
More information about the nginx