Hello,
I installed the web server (nginx 0.7.67) to handle static (html) and dynamic (php) pages.
PHP pages are handled with spawn-fcgi (v1.6.3), which uses php-cgi 5.3.1 as engine.
The web server listen on port 85 and the spawn-fcgi handle PHP requests through port 9000.
I configured nginx as this :
server {
listen 85;
server_name 10.0.0.1;
access_log /mnt/opt/etc/nginx/logs/host.access.log main;
error_log /mnt/opt/etc/nginx/logs/host.error.log debug;
location / {
root /mnt/opt/www/;
index index.html index.htm index.php;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /mnt/opt/etc/nginx/$fastcgi_script_name;
include /mnt/opt/etc/nginx/fastcgi_params;
}
}
and 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;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
PHP pages are well executed, but I get 404 errors in the host.access.log file :
192.168.0.101 - - [09/Oct/2011:12:09:26 +0000] "GET /login.php HTTP/1.1" 404 622 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)" "-"
HTML pages are logged 200, OK. But any PHP page are logged 404, bad request!
I think I make a mistake somewhere in configuration between nginx and php but I can't find it.
Please help me to pinpoint the issue
Thank you
Eki