nginx中設定虛擬目錄的問題?
ringa_lee
ringa_lee 2017-05-16 17:16:45
0
1
330
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學習者快速成長!