Config help needed

Ian Hobson ian at ianhobson.co.uk
Thu Jul 22 23:10:59 MSD 2010


Hi Edho,

On 22/07/2010 18:38, Edho P Arief wrote:

A suggestions that I think should have worked, but....

I tried your suggestions - and they had no effect whatsoever.

This is the current, failing, config - copied from a log, so you can see 
exactly what I have

ian at anake:/etc/nginx/sites-enabled$ ls -al
total 8
drwxr-xr-x 2 root root 4096 2010-07-22 10:18 .
drwxr-xr-x 5 root root 4096 2010-06-21 14:36 ..
lrwxrwxrwx 1 root root   38 2010-06-21 14:33 coachmaster -> 
/etc/nginx/sites-available/coachmaster
lrwxrwxrwx 1 root root   34 2010-06-21 14:36 default -> 
/etc/nginx/sites-available/default
lrwxrwxrwx 1 root root   36 2010-07-22 10:18 SOPSystem -> 
/etc/nginx/sites-available/SOPSystem
ian at anake:/etc/nginx/sites-enabled$ cat default
# default server - if no other domain given
#                - also handle phpmyadmin
server {
     listen 80 default;
     server_name  default.anake.hcs localhost;
     index index.php index.htm index.html;
     root   /var/www/nginx-default/;
     location /doc {
         root   /usr/share;
         autoindex on;
         allow 127.0.0.1;
         deny all;
     }
     location /images {
         root   /usr/share;
         autoindex on;
     }
     #
     # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
     #
     location ~ \.php$ {
          fastcgi_param  SCRIPT_FILENAME  
$document_root$fastcgi_script_name;
          include /etc/nginx/fastcgi.conf;
          fastcgi_pass   127.0.0.1:9000;
     }
     #
     #  pass phpmyadmin/???  to /usr/share/phpmyadmin/???
     #
     location ~ ^/phpmyadmin/.*\.php$ {
          root /usr/share;
          fastcgi_param  SCRIPT_FILENAME  
$document_root$fastcgi_script_name;
          include /etc/nginx/fastcgi.conf;
          fastcgi_pass   127.0.0.1:9000;
     }
     #  handle missing /
     location = /phpmyadmin {
         rewrite ^ /phpmyadmin/ redirect;
     }
     location /phpmyadmin/ {
         root    /usr/share;
         index   index.php;
     }
}

ian at anake:/etc/nginx/sites-enabled$

All the other sites are listen 80. I'm browsing it from another local 
machine
via default.anake.hcs daomin name.

ian at anake:/etc/nginx$ cat fastcgi_params
#fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;

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;

fastcgi_index  index.php;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;
ian at anake:/etc/nginx$
ian at anake:/etc/nginx$ cat nginx.conf
user www-data www-data;
worker_processes  2;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
     worker_connections  512;
}

http {
     include       /etc/nginx/mime.types;
     #include       /etc/nginx/fastcgi_params;

     default_type  application/octet-stream;

     access_log      /var/log/nginx/access.log;
     index  index.php index.html index.htm;
     sendfile        on;
     keepalive_timeout  5;
     tcp_nodelay        on;
     gzip  on;
     include /etc/nginx/sites-enabled/*[a-zA-Z];
}
ian at anake:/etc/nginx$

To summarise the results
/                                       OK - serves index.html
/test.php                            OK - passed to fastcgi.
/phpmyadmin                     No input file specified. (and the URL 
changes to /phpmyadmin/
/phpmyadmin/index.php      No input file specified.

This config appears to me to be correct, yet it is not working.
Anyone?

Regards

Ian



More information about the nginx mailing list