Virtual Directory counterpart in nginx

14,290

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.

Share:
14,290
Handsome Nerd
Author by

Handsome Nerd

Updated on June 24, 2022

Comments

  • Handsome Nerd
    Handsome Nerd about 2 years

    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>
    
  • Handsome Nerd
    Handsome Nerd over 10 years
    Thanks, I also need .php support in them.