nginx中设置虚拟目录的问题?
ringa_lee
ringa_lee 2017-05-16 17:16:45
0
1
333
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;
     }
   }
}

我现在是root /alidata;即指向alidata下的根目录。

如果只指向两个/alidata/A,/alidata/B,如何设置?

ringa_lee
ringa_lee

ringa_lee

全部回复(1)
Ty80

你可以给每个location添加正则来匹配A和B,比如 location/(A|B)/代替~

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!