Problem Background:
Today, when testing a website, we found that there would be a random 4-Character appearance in the first part of the webpage. There is no problem in accessing the general page through reverse proxy, in addition, this type of problem only occurs on the page after nginx reverse proxy and does not appear on the original Apache page.
Read the relevant information to learn:
For any problematic page, the transmission mode is chunked ("Transfer-Encoding: chunked ").
The hexadecimal number (chunk length) of the header and the zero (chunk termination) at the end of the header are the message identifiers of the chunked transmission mode. Apache respone has only one chunk, while nginx respone has four chunks, among them, the header of 1st chunks and the additional bytes at the end of 4th chunks are the original chunk identifiers in Apache respone. The extra characters appear because nginx repeatedly performs the chunked operation on messages that have already been chunked.
Solution:
Add "chunked_transfer_encoding off;" to the server or location segment of the vhost file of the corresponding site.
This article is from the "every minute" blog, please be sure to keep this source http://sofar.blog.51cto.com/353572/1303907