Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just upgraded a bunch of packages, including apache2 and php5, on a Ubuntu 10.04 VPS. Apache is serving php as the backend to an nginx reverse proxy.

Now all of a sudden all connections attempted by nginx to apache are refused. I haven't changed any of the nginx, apache2, or firewall configurations.

The nginx logs indicate requests are refused and a 301 error is returned. Apache2 logs indicate each request is generating a 301 error, which I presume is being fed back to nginx.

My Firefox browser is outputting the following:

"The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete."

Frustration is rising to stratospheric levels. Would greatly appreciate any thoughts on where the problem might be.

EDIT I tried disabling nginx and accessing apache directly, and that works perfectly. I also noticed that when I disable mysql, nginx is able to communicate with apache in order to render the site's error page (due to lack of db connection). So it would appear that perhaps this is a problem with the mysql connectivity, or lack thereof. I'm at a total loss to explain this - considering a total reinstall of everything.

share|improve this question
Please post nginx conf. It's definetly some rewrite. To make sure it's not Apache problem you can try to bring Apache server to some port and try to access the site directly from it. – Dmitry Verkhoturov May 15 '12 at 6:58

This is almost guaranteed to be a rewrite rule gone awry (try saying that five times fast).

From the scenario you described, it sounds like you don't actually need Apache just to have PHP functionality. You can use PHP-FastCGI and (probably) get the same functionality. Here's a tutorial on how to do this correctly. Remove Apache and you're on your way.

share|improve this answer
Thanks Joel, I'm aware of that option but decided against it under this project's circumstances. – user101570 May 15 '12 at 16:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.