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/
 


posted @ 2018-06-26 21:30  kangjie  阅读(5866)  评论(0编辑  收藏  举报