Welcome! Log In Create A New Profile

Advanced

Re: 502 bad gateway error with php5-fpm on Debian 7

Francis Daly
February 21, 2013 08:52AM
On Thu, Feb 21, 2013 at 10:26:22AM +0100, GASPARD Kévin wrote:

Hi there,

> >So: what is the hostname in the url that you try to get, when you see
> >the 502 error?
>
> Trying to install a Wordpress, used a info.php page here:
> http://blog.koshie.fr/wp-admin/info.php

Ok - so the one server{} block that is used is either the one that has
server_name blog.koshie.fr, or is the default one.

> As you can see, there is a 502 Bad Gateway error.

Yes, and that error log shows that:

> 2013/02/21 10:21:22 [error] 1097#0: *5 connect() failed (111: Connection
> refused) while connecting to upstream, client: 46.218.152.242, server:
> koshie.fr, request: "GET /wordpress/info.php HTTP/1.1", upstream:
> "fastcgi://127.0.0.1:9000", host: "blog.koshie.fr"

it is using the server "koshie.fr", not the server
"blog.koshie.fr". Presumably the server "koshie.fr" is the default,
and the server "blog.koshie.fr" does not exist.

So the configuration that is running, is *not* the configuration that
you are showing here.

> Logically, this is the vhost configuration file for
> http://blog.koshie.fr/wp-admin/info.php:

But based on your later mail, this configuration file does not exist.

If you want to get this configured correctly, your best bet is probably
to simplify the configuration significantly.

Leave /etc/nginx/nginx.conf as it is.

Let /etc/nginx/conf.d have exactly one file in it, this one.

Then run your test and see if it works or fails.

> >Maybe it is simplest if you rename the conf.d directory, then create
> >a new conf.d directory with just one vhost file. Then reload nginx and
> >re-do your test of a php request and see what it says.
>
> So, above you've the configuration file related to this log error:

No.

That configuration file does not result in this error.

> >If it still fails, then you have a simpler test case to work from.
>
> What is this test case please?

Your test case is:

* you run "curl -i http://blog.koshie.fr/wordpress/info.php"
* you expect to see some useful content
* you actually see a 502 error.

Then do whatever it takes to get the expected output.

I think that one part of the problem is that you have only half-changed
from an old system to a new system.

You new system has nothing listening on 127.0.0.1:9000, so any
configuration that mentions that ip:port is broken. It should be removed,
or replaced with the unix socket.

And your new system does not actually include all of the files that you
want it to.

When your nginx starts, it reads exactly one configuration file:
/etc/nginx/nginx.conf.

That file then uses "include" to read some other files. Those other
files do not seem to be the ones you want, for some reason.

I suggest: stop nginx. Make sure it is stopped, and not running, and
has nothing listening on port 80 or port 443. Then look at the files
in /etc/nginx/conf.d, and make sure that they are exactly the ones that
you want. Then start nginx, access the info.php url, and see if it works.

Good luck,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

502 bad gateway error with php5-fpm on Debian 7

GASPARD Kévin February 20, 2013 05:30PM

Re: 502 bad gateway error with php5-fpm on Debian 7

Francis Daly February 20, 2013 05:42PM

Re: 502 bad gateway error with php5-fpm on Debian 7

GASPARD Kévin February 20, 2013 05:56PM

Re: 502 bad gateway error with php5-fpm on Debian 7

Francis Daly February 20, 2013 06:14PM

Re: 502 bad gateway error with php5-fpm on Debian 7

GASPARD Kévin February 20, 2013 06:38PM

Re: 502 bad gateway error with php5-fpm on Debian 7

Francis Daly February 20, 2013 06:56PM

Re: 502 bad gateway error with php5-fpm on Debian 7

GASPARD Kévin February 21, 2013 04:26AM

Re: 502 bad gateway error with php5-fpm on Debian 7

Wolfsrudel February 21, 2013 05:17AM

Re: 502 bad gateway error with php5-fpm on Debian 7

Wolfsrudel February 21, 2013 05:26AM

Re: 502 bad gateway error with php5-fpm on Debian 7

GASPARD Kévin February 21, 2013 06:10AM

Re: 502 bad gateway error with php5-fpm on Debian 7

Mark Alan February 21, 2013 07:48AM

Re: 502 bad gateway error with php5-fpm on Debian 7

GASPARD Kévin February 21, 2013 08:10AM

Re: nginx + php5-fpm on Debian

Mark Alan February 21, 2013 03:08PM

Re: 502 bad gateway error with php5-fpm on Debian 7

w.b March 01, 2013 08:56AM

Re: 502 bad gateway error with php5-fpm on Debian 7

GASPARD Kévin February 21, 2013 06:14AM

Re: 502 bad gateway error with php5-fpm on Debian 7

Francis Daly February 21, 2013 08:52AM

Re: 502 bad gateway error with php5-fpm on Debian 7

GASPARD kévin March 02, 2013 02:02PM

Re: 502 bad gateway error with php5-fpm on Debian 7

GASPARD kévin March 02, 2013 02:16PM

Re: 502 bad gateway error with php5-fpm on Debian 7

GASPARD kévin March 03, 2013 07:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 259
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready