Welcome! Log In Create A New Profile

Advanced

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

GASPARD Kévin
February 21, 2013 04:26AM
> Hi there,
>
>> >Looking at your config file, plus every file include'd in it, can you
>> >see which one server{} block is used for this request? (You'll need
>> >to look at all of the "listen" directives first, and then all of the
>> >"server_name" directives in the server{}s with the "listen" that best
>> >matches the incoming ip:port.)
>> >
>> >What fastcgi_pass line is used in that one server{} block?
>>
>> I've do a grep -R 'listen' /etc/nginx/conf.d/ and every vhost
>> configuration file have two lines, exactly the same:
>>
>> listen 80;
>> listen 443 ssl;
>
> Ok, since all of the "listen" lines are the same, then the server{}
> that is chosen depends on the host name used in the test request.
>
> 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

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

> And which vhost configuration file has the matching server_name
> directive? If there is no exact match, then the first regex match is
> used. If there is none, then the default server{} is used. Which exactly
> is "the first regex" may not be immediately obvious if there are some
> in different files.

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

server {
listen 80;
listen 443 ssl;
# server_name 176.31.122.26;
server_name blog.koshie.fr www.blog.koshie.fr;
root /var/www/koshie.fr/blog/wordpress;

msie_padding on;
ssl_session_timeout 5m;

ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;

# index index.php;
# fastcgi_index index.php;

client_max_body_size 8M;
client_body_buffer_size 256K;

location ~ \.php$ {
include fastcgi_params;

# Assuming php-fastcgi running on localhost port 9000
# fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;

fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
}
}

}



>> I'm sorry but I'm not sure to understand why you are asking me to do
>> and I
>> given you what I can. If I miss something can you point me on the good
>> way
>> please?
>
> The problem you report is consistent with the log output you showed.
>
> But the configuration you showed is not consistent with that log output.
>
> So something is unexpected.
>
> 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:

2013/02/21 09:37:35 [error] 3631#0: *1476 connect() failed (111:
Connection refused) while connecting to upstream, client: 46.218.152.242,
server: island.koshie.fr, request: "GET /wp-admin/info.php HTTP/1.1",
upstream: "fastcgi://127.0.0.1:9000", host: "blog.koshie.fr"
2013/02/21 09:37:35 [debug] 3631#0: timer delta: 1
2013/02/21 09:37:35 [debug] 3631#0: posted events 0000000000801CA0
2013/02/21 09:37:35 [debug] 3631#0: posted event 0000000000801CA0
2013/02/21 09:37:35 [debug] 3631#0: posted event 0000000000000000
2013/02/21 09:37:35 [debug] 3631#0: worker cycle
2013/02/21 09:37:35 [debug] 3631#0: epoll timer: 65000

I've copied /etc/nginx/conf.d/ to /etc/nginx/conf.d.backup/, removed files
into /etc/nginx/conf.d/ and moved /etc/nginx/conf.d/koshie.fr.conf and
/etc/nginx/conf.d/blog.koshie.fr.conf to /etc/nginx/conf.d/ (because
unless the both conf I has an error... With squid ! I don't get it, I've
no squid on my desktop or my server, anyway... I think it's maybe related
to the fact koshie.fr is the main domain?), restarted nginx and koshie.fr
works, but blog.koshie.fr/wordpress/info.php gimme again a 502. This is
the log for this request:

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"
2013/02/21 10:21:22 [debug] 1097#0: timer delta: 0
2013/02/21 10:21:22 [debug] 1097#0: posted events 00000000007299F0
2013/02/21 10:21:22 [debug] 1097#0: posted event 00000000007299F0
2013/02/21 10:21:22 [debug] 1097#0: posted event 0000000000000000
2013/02/21 10:21:22 [debug] 1097#0: worker cycle
2013/02/21 10:21:22 [debug] 1097#0: epoll timer: 65000

> If it still fails, then you have a simpler test case to work from.

What is this test case please?

Cordially, Koshie

_______________________________________________
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: 96
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