Real Dreams
Real Dreams

Reputation: 18010

Virtual Directory counterpart in nginx

It seems nginx does not support embeded location bloks. Does this mean there is no VirtualDirectory counterpart in nginx?

What is nginx conf of following Apache 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>

Upvotes: 8

Views: 17326

Answers (1)

Tan Hong Tat
Tan Hong Tat

Reputation: 6864

It would be:

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

Note that there is a longstanding bug that alias and try_files don't work together.

Upvotes: 10

Related Questions