Virtual directory in nginx

Nginx doesn't seem to support inline blocks location. Does this mean that there is no analogue in nginx VirtualDirectory?

What is nginx conf from the 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>
+3
source share
1 answer

This will:

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

Note that there is a long-standing error that the alias and try_files do not work together.

+4
source

All Articles