nginx虚拟目录配置

参考文章:https://blog.csdn.net/whatday/article/details/50649461

 
1. location ~ ^/awstats/ {
      root  /home/awstats/;
访问:http://test.com/awstats/ 实际访问的是/home/awstats/awstats/

 
2.      location ~ ^/awstats/ {
        alias  /home/
访问:http://test.com/awstats/ 实际访问的是/home/

3.      location ~ ^/awstats/ {                        #使用alias时目录名后面一定要加“/”
        alias  /home/awstats/;
访问:http://test.com/awstats/ 实际访问的是/home/awstats/

4.      location ~ ^/awstats/ {
        root  /home/;

访问:http://test.com/awstats/ 实际访问的是/home/awstats/
 


原文地址:https://www.cnblogs.com/taiguyiba/p/9231337.html