Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

502 Bad Gateway with unexpected fastcgi record #160

Open
filmost opened this Issue Feb 25, 2014 · 10 comments

Comments

Projects
None yet
8 participants
@filmost
Copy link

filmost commented Feb 25, 2014

I have been testing this configuration locally and I keep getting these 502 Bad Gateway. They appear to happen when there is a redirect to a URL with arguments. An example would be after user login the page redirects to "/node?q=/" which throws a 502 Bad Gate error. If I refresh the page, then it loads as it should.

Checking error logs reveals the following error message:

2014/02/25 15:34:09 [error] 18430#0: *12 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 127.0.0.1, server: d82.localhost, request: "GET /node?q=/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "d82.localhost", referrer: "http://d82.localhost/"

This happens with unix sockets as well.

If I revert to my old configuration then login redirects to a clean URL (/node) instead and there is no 502 error.

Can you shed some light on what area of config I should be looking at? I am using nginx 1.2.6

@filmost

This comment has been minimized.

Copy link
Author

filmost commented Feb 27, 2014

I notice using your configs, my redirected URLS always end up like this "/admin/content?q=/admin/content" which where I get the 502s. What controls the URL structure?

@sebas5384

This comment has been minimized.

Copy link

sebas5384 commented Apr 17, 2014

well I can confirm, something change in the past 3 or 4 month, because with new projects I'm getting this 502 bad gateways after posts for example. Things where getting better after commenting: include nginx_status_vhost.conf;

Some tip of what can be?

@sebas5384

This comment has been minimized.

Copy link

sebas5384 commented May 26, 2014

@perusio I made(not finished) a juju charm, using your configurations, but! the 502 thing is still happening, and I really don't know why :(
Here's the code https://github.com/sebas5384/charm-drupal/blob/bash/hooks/install

Some help? please :)

@njt1982

This comment has been minimized.

Copy link

njt1982 commented Oct 1, 2014

@sebas5384 Did you ever resolve this? I'm getting it locally with a Drupal 8.0b1 install.

@wismoyo

This comment has been minimized.

Copy link
Contributor

wismoyo commented Feb 26, 2015

It also happened to one of my project. Error 502 often occurs at the beginning, but when in reloading, back to normal. and this happens at random but constant. I also tried various combinations of settings does not work, I finally found the discussion here: https://groups.drupal.org/node/283558#comment-1016818 and commenting out keepalive 5 in upstream_phpcgi_unix.conf fixed this 502 issue for me.

@ttenz

This comment has been minimized.

Copy link

ttenz commented Jul 19, 2015

I have turn on tcp and now all is ok!

@njt1982

This comment has been minimized.

Copy link

njt1982 commented Oct 9, 2015

keepalive fixes this for me too

@guiajlopes

This comment has been minimized.

Copy link

guiajlopes commented Nov 24, 2015

I commented the keepalive on Drupal 8 project and it solved my issues related to 502. Everyone know the origin of this issue? Should we implement it for Drupal 8 configurations? I think just comment it is not a good solution...

@perusio

This comment has been minimized.

Copy link
Owner

perusio commented Nov 25, 2015

I have no clue. It requires some delving into it. Let's see if by next month I can setup drupal 8 and try to debug the issue.

@mustanggb

This comment has been minimized.

Copy link

mustanggb commented Nov 26, 2015

I'm still seeing this for new installs as well, the keepalive workaround still works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.