server {
listen 80;
server_name localhost;
index index.html index.htm index.php;
root /alidata;
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
location / {
if (!-e $request_filename)
{
rewrite (.*) /index.php;
}
}
}
I am now root /alidata; that is, pointing to the root directory under alidata.
If it only points to two /alidata/A and /alidata/B, how to set it?
You can add regular rules to each location to match A and B, such as
location/(A|B)/
代替~