drupal-nginx icon indicating copy to clipboard operation
drupal-nginx copied to clipboard

Bad Gateway error on bigger code changes

Open mhavelant opened this issue 7 years ago • 4 comments

Hi! Whenever I try to do a major code update (composer update drupal/core for example) my sites just return 502 and I have to stop the environment, docker rm the nginx container and up it again. This happens on multiple projects.

Our used image

  • wodby/drupal-nginx:8-1.13-2.4.2

However, updating to wodby/drupal-nginx:8-1.13-3.0.1 doesn't help either, it produces the same thing.

Environment:

  • Ubuntu 16.04
  • Docker version 17.05.0-ce, build 89658be
  • docker-compose version 1.16.1, build 6d1ac219

Also, it doesn't matter if the composer update happens inside the container or on the host, both tend to result in this error.

Additionally, I only have these services enabled:

  • mariadb
  • php
  • nginx
  • mailhog
  • traefik

The site is D8 via the drupal-composer project.

mhavelant avatar Nov 02 '17 12:11 mhavelant

I have the same issue, increasing NGINX_FASTCGI_BUFFERS and NGINX_FASTCGI_BUFFER_SIZE also did not seem to help?

The error I get is: upstream sent too big header while reading response header from upstream

seanBlommaert avatar Nov 09 '17 13:11 seanBlommaert

Using the latest images AND adding the following seems to solve it for me:

  • nginx service / environment / NGINX_STATIC_CONTENT_OPEN_FILE_CACHE: "off"

I didn't get the 502 since adding the envs and recreating the images.

mhavelant avatar Nov 09 '17 13:11 mhavelant

Just debugged this and found out when a large set of cache tags are added to the Cache-Tags header (in my case this has 4011 characters), the error occurs. Not sure if this is a separate issue, but as mentioned before increasing NGINX_FASTCGI_BUFFERS and NGINX_FASTCGI_BUFFER_SIZE did not seem to help? If anyone has some tips that would be very welcome!

seanBlommaert avatar Nov 09 '17 18:11 seanBlommaert

I have been running into this issue alot I was using the same version Docker version 17.05.0-ce, build 89658be. I have updated my servers and it seemed to resolve a lot of this. There was some networking stuff done in docker 17.10 that may have helped with this.

webdobe avatar Mar 30 '18 00:03 webdobe