Other answers are correct, But I want to note some other aspect of the problem. I had the same issue when I was reverse proxy a reverse proxy, I mean I was two different Nginx back to back. The problem was the first Nginx and when I removed the first Nginx the problem solved.