Nginx virtual directory root and alias difference

Source: Internet
Author: User
Tags parent directory

When you recently deployed the Log Analysis tool Awstats on Nginx, when configuring Awstats analysis results for web browsing, Analysis results page access is always 404. Later looked at some data, found that the use of root and alias difference did not understand the cause, here specifically will be the difference between the two detailed way, for everyone to learn reference.

Nginx actually does not have the virtual host this argument, because it originally is completely according to the catalog to design and work. If you have to install a virtual directory for Nginx, then only the alias is more "like".

What is the difference between the alias label and the root label?

1, the alias followed by the specified directory is accurate, and the end must be added "/", otherwise the file could not be found

location/c/{

alias/a/

}

This column more highlights: http://www.bianceng.cn/Servers/web/

If you visit a site http://location/c access is the site information in the/a/directory.

2, Root followed by the specified directory is the parent directory, and the parent directory to contain and location after the name of the specified directory, the end of the "/" plus does not matter.

location/c/{

root/a/

}

If you visit a site http://location/c access is the site information in the/A/C directory.

3. In general, it is a good habit to configure the alias in Location/other in Location/in the configuration of root.

Other messy things here is not nonsense, as long as the understanding of this point, the day-to-day operation of a few to understand.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.