【问题标题】:Virtual Directory counterpart in nginxnginx 中的虚拟目录对应项
【发布时间】:2014-03-04 21:11:33
【问题描述】:

似乎 nginx 不支持嵌入 location bloks。这是否意味着nginx中没有VirtualDirectory对应?

以下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>

【问题讨论】:

标签: apache nginx virtual-directory


【解决方案1】:

应该是:

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

请注意,有一个长期存在的错误,即 alias 和 try_files 不能一起工作。

【讨论】:

  • 谢谢,我还需要它们中的 .php 支持。
猜你喜欢
  • 1970-01-01
  • 2019-03-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-07-22
  • 2011-01-08
相关资源
最近更新 更多