How does nginx determine whether or not to cache something?
By default, NGINX respects the Cache-Control headers from origin servers. It does not cache responses with Cache-Control set to Private, No-Cache, or No-Store or with Set-Cookie in the response header. NGINX only caches GET and HEAD client requests.
NGINX will not cache responses if proxy_buffering is set to off. It is on by default.
Validate configuration
nginx -c /etc/nginx/nginx.conf -t