Problem with nginx/0.8.54 and alias

Edho P Arief edhoprima at gmail.com
Fri Feb 18 11:10:44 MSK 2011


On Thu, Feb 17, 2011 at 8:58 PM, Igor Sysoev <igor at sysoev.ru> wrote:
> 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;
>  }
>
>

more like, it goes like this:

######################

#this goes first or hell will broke loose
location ~ ^/phpmyadmin/(.*\.php)$ {
  alias /var/www/monsite.fr/phpMyAdmin/$1;
  fastcgi_pass 127.0.0.1:9000;
  fastcgi_param SCRIPT_FILENAME $request_filename;
  include fastcgi_params;
}

#this must be done
location = /phpmyadmin {
  rewrite ^ $scheme://$host$uri/ permanent;
}

#usual business
location /phpmyadmin/ {
  index index.php; alias /var/www/monsite.fr/phpMyAdmin/;
}

######################

though from my experience it's much better to use symlink instead of
alias. If "if" is evil, "alias" is lesser evil.



More information about the nginx mailing list