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>
Virtual host config files are typically located in the /etc/nginx/sites-available directory. You may also notice that your server has a /etc/nginx/sites-enabled folder, which is where file shortcuts (symbolic links) are placed.
A virtual directory is a path or alias within a website that refers users to another directory where the actual data is hosted. The referred directory can be a physical directory on a local server's hard drive or a directory on another server (network share).
Nginx Server Blocks allows you to run more than one website on a single machine. With Server Blocks, you can specify the site document root (the directory which contains the website files), create a separate security policy for each site, use different SSL certificates for each site, and much more.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With