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 127.0.0.1 -p 53217 -P /var/run/fastcgi-php.pid -- /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 {
listen xxx.xxx.xxx.xxx:81;
server_name domain.com www.domain.com;
access_log /home/domain.com/nginx.access.log;
root /home/domain/public_html/; # absolute path to WordPress installation
try_files $uri $uri/ /index.php;
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:53217;
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.
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?