502 bad gateway error with php5-fpm on Debian 7

GASPARD kévin list-reader at koshie.fr
Sun Mar 3 12:38:04 UTC 2013


Hi,

I've solved my issue, I've moved all wordpress file into the document root  
of blog.koshie.fr, modified it into /etc/nginx/conf.d/blog.koshie.fr.conf  
according to my new structure and now it works.

Again thanks :).

Le Sat, 02 Mar 2013 20:14:55 +0100, GASPARD kévin <list-reader at koshie.fr>  
a écrit:

> Well, in fact I've a new problem.
>
> info.php file works, so php works.
>
> But when I'm trying to access to my install.php file for wordpress  
> installation I've "File not found." and in /var/log/nginx/error.log I  
> have: "*1 FastCGI sent in stderr: "Primary script unknown" while reading  
> response header from upstream, client: 89.2.128.79, server:  
> blog.koshie.fr, request: "GET /wp-admin/install.php HTTP/1.1", upstream:  
> "fastcgi://unix:/var/run/php5-fpm.sock:", host: "blog.koshie.fr""
>
> An idea? I've googled a little and some peoples talk about  
> /etc/nginx/fastcgi_params's SCRIPT_FILE_NAME parameters. But I don't  
> understand what value to put into.
>
> PS : Sorry for the noise of my last e-mail.
>
> Cordially, Koshie
>
> Le Sat, 02 Mar 2013 20:00:47 +0100, GASPARD kévin  
> <list-reader at koshie.fr> a écrit:
>
>> I've removed all "127.0.0.1:9000" lines by "fastcgi_pass  
>> unix:/var/run/php5-fpm.sock;" and everything works now :-).
>>
>> Thanks for your help !
>>
>> Le Thu, 21 Feb 2013 14:50:41 +0100, Francis Daly <francis at daoine.org> a  
>> écrit:
>>
>>> 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
>>
>>
>
>


-- 
Utilisant le logiciel de courrier d'Opera : http://www.opera.com/mail/



More information about the nginx mailing list