Config help needed

Ian Hobson ian at ianhobson.co.uk
Fri Jul 23 12:28:42 MSD 2010


Hi All,

Found what was happening but I don't know how to fix it.

if I remove the clause starting  "location ~ \.php$ { "  then phpmyadmin 
works.

How can I stop it firing when the URL does NOT contain "phpmyadmin" ???

This is the full config.

On 22/07/2010 20:10, Ian Hobson wrote:
> # 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$






More information about the nginx mailing list