Problem with nginx/0.8.54 and alias

Igor Sysoev igor at sysoev.ru
Thu Feb 17 16:58:22 MSK 2011


On Thu, Feb 17, 2011 at 08:16:39AM -0500, Amanager wrote:
> Hello,
> 
> I try to set up a simple alias louse find out how. I read many articles.
> I almost try everything but nothing works. Currently I have this code in
> the file /etc/nginx/sites-available/default.
> [code]
> server {
>         listen   80;
>         root /var/www/monsite.fr;
>         index index.html index.htm index.php;
>         server_name monsite.fr;
> 
>         location /phpmyadmin {
>                 access_log off;
>                 alias /var/www/monsite.fr/phpMyAdmin;
>                 index index.html index.php;
>         }
> 
>         location / {
>                 try_files $uri $uri/ /index.html;
>         }
>         
>         location ~ \.php$ {
>                 fastcgi_pass 127.0.0.1:9000;
>                 fastcgi_index index.php;
>                 fastcgi_param  SCRIPT_FILENAME
> $document_root$fastcgi_script_name;
>                 include fastcgi_params;
>         }
> }
> [/code]
> 
> When I launch my browser's page http://monsite.fr/phpmyadmin/ I fall on
> the index.html file that I put in the directory
> /var/www/monsite.fr/phpMyAdmin/. By cons, when I run
> http://monsite.fr/phpmyadmin/index.php, there is nothing. The header
> returned is HTTP/1.1 404 Not Found.

Use late 0.8.x with this configuration:

 location ~ ^/phpmyadmin/(?<NAME>.+\.php)$ {
     fastcgi_pass 127.0.0.1:9000;
     fastcgi_param SCRIPT_FILENAME
                   /var/www/monsite.fr/phpMyAdmin/$NAME;
     include fastcgi_params;
 }


-- 
Igor Sysoev
http://sysoev.ru/en/



More information about the nginx mailing list