2014-02-07 50 views
3

看來nginx不支持嵌入location bloks。這是否意味着在nginx中沒有VirtualDirectory副本?nginx虛擬目錄對應

什麼是以下的Apache的conf的nginx的CONF:

Alias /foo "D:\www\foo\public" 
<Directory "D:\www\foo\public"> 
    # some settings 
</Directory> 
Alias /bar "D:\www\bar\public" 
<Directory "D:\www\bar\public"> 
    # some other config 
</Directory> 
+0

你的意思是別名? –

+0

@HongTat是的,我喜歡! – PHPst

+0

http://wiki.nginx.org/HttpCoreModule#alias –

回答

4

這將是:

location /foo/ { 
    alias d:/www/foo/public/; 
} 
location /bar/ { 
    alias d:/www/bar/public/; 
} 

請注意,有一個長期的錯誤,別名和try_files不一起工作。

+0

謝謝,我也需要.php支持。 – PHPst