FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream

chatchat nginx-forum at nginx.us
Sun Sep 23 23:40:38 UTC 2012


Hello,

I went to setup Nginx with php-fpm.

I have3 vhosts for the moment .
I made a script to create vhost and pool file for php-fpm.

I don't know why but my firsts 2 vhosts work but not the third, i obtain
this message in a blank page :
File not found.

So, in my log error file :
2012/09/24 00:57:12 [error] 23782#0: *422 FastCGI sent in stderr: "Primary
script unknown" while reading response header from upstream, client:
XX.XX.XX.XX, server: domain.com, request: "GET /phpinfo.php HTTP/1.1",
upstream: "fastcgi://127.0.0.1:9003", host: "www.domain.com"

This is my vhost :

server {
   listen       80;
   server_name  domain.com www.domain.com;
   if ($host !~* ^www\.){
            rewrite ^(.*)$ $scheme://www.domain.com;
   }
   root   /home/domain/www;
   index index.html index.htm index.php;
   
   access_log /home/domain/logs/domain-access.log;
   error_log  /home/domain/logs/domain-error.log;
        
       location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {
           access_log        off;
           error_log		 off;
           expires           max;
           add_header Pragma public;
           add_header Cache-Control "public, must-revalidate,
proxy-revalidate";
       }

       error_page   500 502 503 504  /50x.html;
       location = /50x.html {
           root   /usr/share/nginx/www;
       }
       fastcgi_intercept_errors on;
       location ~ \.php$ {
           fastcgi_pass   127.0.0.1:9003;
           fastcgi_index  index.php;
           fastcgi_param  SCRIPT_FILENAME 
$document_root$fastcgi_script_name;
           include        /etc/nginx/fastcgi_params;
       }
}

and php-fpm pool :

; Nom du pool
[domain]
; On utilisera une socket
listen = 127.0.0.1:9003

; Permission pour la socket
listen.owner = domain
listen.group = domain
listen.mode = 0666
listen.backlog = -1

; Utilsateur/Groupe des processus
user = domain
group = domain

; On choisira une gestion dynamique des processus
pm = dynamic

pm.max_children = 10
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 5

request_terminate_timeout = 2
request_slowlog_timeout = 1
slowlog = /home/domain/logs/domain-slow.log

chroot = /home/domain/
    ; Chdir to this directory at the start. This value must be an absolute
path.
    ; Default Value: current directory or / when chroot
    chdir = /www/
catch_workers_output = yes

env[HOSTNAME] = $HOSTNAME
env[TMP]      = /tmp
env[TMPDIR]   = /tmp
env[TEMP]     = /tmp

; Quelques directives de configuration de PHP
php_flag[display_errors]            = on
php_admin_value[error_log]          = /logs/php_err_domain.log
php_admin_flag[log_errors]          = on
php_admin_value[memory_limit]       = 1M
php_admin_value[upload_max_filesize]= 8M
php_value[max_execution_time]       = 2
php_value[include_path]             = .:/usr/share/pear:/usr/share/php

Do you have an idea why i have this error ?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,230967,230967#msg-230967



More information about the nginx mailing list