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 have a Wordpress site running on Apache that is heavily overloaded, so I want to try replacing it with nginx/fastcgi to see if it would help.

I compiled spawn-fcgi and nginx configured a server that would run on port 81 as a test. When I try accessing the site, it says "Waiting for site" and never loads (and the access logs does not show anything)

I started spawn-cgi like so:

/usr/local/bin/spawn-fcgi -a -p 53217 -P /var/run/ -- /usr/bin/php-cgi

and here's my nginx config:

http {
    include   /etc/nginx/mime.types;
    default_type  application/octet-stream;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    server {
      access_log  /home/;
      root        /home/domain/public_html/;  # absolute path to WordPress installation

      try_files $uri $uri/ /index.php;

      location ~ \.php$ {
        include        fastcgi_params;

        fastcgi_index   index.php;
        fastcgi_param   SCRIPT_FILENAME /home/domain/public_html$fastcgi_script_name;




events {
    worker_connections  1024;

and finally, here is my fastcgi_params file:

fastcgi_param  QUERY_STRING   $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE   $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI   $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

Is there anything in my config that would stop me from serving a basic WP site? I'm running this on CentOS on a dedicated box.

share|improve this question
Is your port 81 firewalled, by any chance? – Vladimir Blaskov Aug 14 '11 at 18:49
Not the question you asked - but why not Apache + mod_fcgid so your Apache processes are smaller? – EightBitTony Aug 14 '11 at 19:53
@vladmir: firewall rules are fine. I even stopped iptables and checked.. it's the same – Jahufar Aug 15 '11 at 0:44
@EightbitTony: Currently using mod_fcgid... – Jahufar Aug 15 '11 at 0:48

Technically not an answer - but how about running a network trace (tcpdump / wireshark) on the server and/or client and see what it's trying to do?

share|improve this answer

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.