Problem setting virtual directory in nginx?
ringa_lee
ringa_lee 2017-05-16 17:16:45
0
1
331
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?

ringa_lee
ringa_lee

ringa_lee

reply all(1)
Ty80

You can add regular rules to each location to match A and B, such as location/(A|B)/代替~

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!