Differences between the root and alias commands configured by nginx on the FastDFS storage Server

Source: Internet
Author: User

The difference between the root and alias commands configured by nginx on the FastDFS storage server the difference between the root and alias commands alias is the definition of a directory alias, root is the definition of the top-level directory 1 location/img/{2 alias/var/www/image/; 3} 4 # If you follow the above configuration, when you access the files in the/img/directory, ningx will automatically go to the/var/www/image/directory to find the file 5 location/img/{6 root/var/www/image; 7} 8 # if you follow this configuration, when accessing files in the/img/directory, nginx will go to the/var/www/image/img/directory to find a file. Another important difference is that "/" must be used after alias; otherwise, the file cannot be found. Root can have non-Configuration Analysis 01 server {02 listen 80; 03 server_name image1 .***. com image2 .***. com; 04 charset UTF-8; 05 location/{06 root html; 07} 08 location/image1/M00 {09 alias/data/01/; 10 ngx_fastdfs_module; 11} 12 13 location/image1/M01 {14 alias/data/02/; 15 ngx_fastdfs_module; 16} 17} url instance: http ://***. com/image1/M00/05/03/01/05/Hangzhou server:/data/03/cgaaq1f%3yiaaaaaacpr%q1saah1mqdutf8abw9d233_310x310.jpg

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.