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 is running with nginx1.2, php-fpm, apc on an ubuntu server (medium - amazon ec2). I have been tweaking my server for past 6 months, however a problem started occurring since day before yesterday.

I am unable to resolve the root for, or It takes 3 minutes to receive a broken page with all the links on the page converted to the local ip (10.x.x.x) However, any other url,, or, or etc. resolve perfectly and with the characteristic nginx speed (i am a big fan)! Even resolves perfectly which is basically the same server root i.e So it seems that requests can not be resolved only if passed without any url at the end.

I came up with the following three possibilities why this could be happening: 1- incorrect host setup - i might be passing incorrect host information in some setting i.e in php-fpm.conf, php.ini, or nginx.conf or in ubuntu under hosts, or hostname.conf etc. 2- incorrect index setup - i might be passing incorrect index types in nginx.conf or php-fpm.conf 3- anything is possible :(

Most importantly, this problem goes away, if I stop using the "server_name" directive in nginx.conf. So an un-named nginx server block leads to normal operation, but the moment I put in the server_name directive to or, then again the domain root becomes unreachable.

This has been driving me crazy for the past two days. Ceaseless googling has been of little help, as it is probably a configuration mis-directive. I humbly bend down, before my computer overlords! Please help!

share|improve this question
Post your config? – EightBitTony Oct 19 '12 at 8:41
My config is as follows - nginx.conf - nginx-site.conf - php-fpm.conf - php-fpm-www-pool.conf - – Apurva Sukant Oct 19 '12 at 9:28
@ApurvaSukant Please edit your question to include the relevant portions of the config. Pastebin will eventually delete what you've uploaded and render your question useless. Thanks! – voretaq7 Oct 19 '12 at 18:34
This is unlikely to be related to nginx. For the URI / nginx will apply your index directive and internally redirect to /index.php which will then hit your \.php$ location and be sent to PHP just like URI /index.php would. The only real difference to PHP will be the $_SERVER['REQUEST_URI'] value which will be / versus /index.php. Your app might do routing wrong in that case. – Martin Fjordvald Oct 21 '12 at 10:46
Martin your comment is a correct explanation of the situation. I was able to resolve this, when I discovered Wordpress with W3 Total Cache was incorrectly processing the requests. The php caching setup implemented by W3TC works with a single named domain only, so requests coming from other names were leading to infinite redirect loops. I was able to resolve this by editing default.conf to rewrite all requests within one server block, instead of the preferred method of 301 redirecting from other server blocks which wasn't working even with server_name_in redirect and port_in_redirect off. – Apurva Sukant Nov 12 '12 at 7:18

Your Answer


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

Browse other questions tagged or ask your own question.