title: 502 Bad Gateway error - upstream sent too big header while reading response header from upstream
body: <p>I'm using wordpress in Google App Engine. When I make a POST API, getting an Error : "upstream sent too big header while reading response header from upstream". which returns 502, Bad Gateway, nginx</p>
  
  <p>The data(JSON) i'm sending in POST API is around 4kb. If the Data is sent below 2kb API returns success.</p>
  
  <p>I tried App Engine Standard and Flexible Environment, but facing the same issue.</p>
  
  <p>As per this link:
  <a href="https://stackoverflow.com/questions/23844761/upstream-sent-too-big-header-while-reading-response-header-from-upstream">upstream sent too big header while reading response header from upstream</a></p>
  
  <p>Modifying the nginx-app.config file with buffers will fix this issue. But it's not working.</p>
  
  <p>In App Engine, the default nginx-app.config looks like.</p>
  
  <pre><code>location / {
      try_files $uri /index.php?q=$uri&amp;$args;
  }
  
  location ~ ^/wp-admin {
      try_files $uri $uri/index.php?$args;
  }
  </code></pre>
  
  <p>Not sure where I need to add these proxy buffers.</p>
  
  <p>I tried adding the proxy buffers inside the default locations as shown below, but it didn't help.</p>
  
  <pre><code>location / {
      try_files $uri /index.php?q=$uri&amp;$args;
      fastcgi_buffers 16 16k;
      fastcgi_buffer_size 32k;
      proxy_buffer_size 128k;
      proxy_buffers 4 256k;
      proxy_busy_buffers_size 256k;
  }
  </code></pre>
  
  <p>Kindly help me to fix this issue.</p>