2011年2月18日星期五

Re: Problem with nginx/0.8.54 and alias

On Thu, Feb 17, 2011 at 8:58 PM, Igor Sysoev <igor@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.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

没有评论:

发表评论