[转]nginx虚拟目录(alias与root的区别)
server_name test.com;
charset utf-8,GB2312;
index index.html;
root html;
access_log logs/access.log main;
}
root /home/awstats/;
index index.html;
access_log off;
error_log off;
charset gb2312;
}
server_name test.com;
charset utf-8,GB2312;
index index.html;
root html;
access_log logs/access.log main;
}
alias /home/;
index index.html;
access_log off;
error_log off;
charset gb2312;
}
server_name test.com;
charset utf-8,GB2312;
index index.html;
root html;
access_log logs/access.log main;
}
alias /home/awstats/;
index index.html;
access_log off;
error_log off;
charset gb2312;
}
server_name test.com;
charset utf-8,GB2312;
index index.html;
root html;
access_log logs/access.log main;
}
root /home/;
index index.html;
access_log off;
error_log off;
charset gb2312;
}
root /home/awstats/;
访问:http://test.com/awstats/ 实际访问的是/home/awstats/awstats/
alias /home/
alias /home/awstats/;
root /home/;
访问:http://test.com/awstats/ 实际访问的是/home/awstats/
借用ayou老师的一句话:
一般情况下,在location /中配置root,在location /other中配置alias是一个好习惯
[转]nginx虚拟目录(alias与root的区别)的更多相关文章
- Nginx虚拟目录alias和root目录
nginx是通过alias设置虚拟目录,在nginx的配置中,alias目录和root目录是有区别的:1)alias指定的目录是准确的,即location匹配访问的path目录下的文件直接是在alia ...
- Nginx设置alias实现虚拟目录 alias与root的用法区别
Nginx 貌似没有虚拟目录的说法,因为它本来就是完完全全根据目录来设计并工作的.如果非要给nginx安上一个虚拟目录的说法,那就只有alias标签比较"像",干脆来说说alias ...
- Nginx虚拟目录(alias)和根目录(root)
功能要求: 假设nginx配置的域名是www.kazihuo.com,现有静态资源/home/www/oye目录需要通过nginx访问. 功能实现: 前提要求: 1.在nginx.conf中到处第二行 ...
- Nginx虚拟目录设置
location ~ .*\.html$ 匹配所有以.html结尾的链接 --------------------------------------------------------- 关于a ...
- Nginx 虚拟目录和虚拟主机的配置
nginx.conf 配置文件的几个常用命令 nginx 配置文件主要分为六个区域: main: 全局设置 events: nginx工作模式 http: http设置 sever: 主机设置 loc ...
- nginx虚拟目录实现两个后台使用
购买了阿里云机器,准备搭建一套备份的后台,由于资源有限所以将两个后台搭建到一组SLB下的两台WEB上. 使用软件:NGINX+PHP root@xx conf.d]# yum install php- ...
- Nginx(alias 和 root的区别)
Nginx(alias 和 root的区别)1.alias 和 root 的区别: location /request_path/image { root /local_path/image/; } ...
- nginx“虚拟目录”不支持php的解决办法
这几天在配置Nginx,PHP用FastCGI,想装一个phpMyAdmin管理数据库,phpMyAdmin不想放在网站根目录 下,这样不容易和网站应用混在一起,这样phpMyAdmin的目录就放在别 ...
- nginx的alias与root的区别
root的写法: location /request_path/image/ { root /local_path/image/; } 这样配置的结果就是当客户端请求 /request_path/im ...
随机推荐
- rabbitmq&&erlang 安装
# yum install epel-release CentOS and Red Hat Enterprise Linux 6.x wget https://dl.fedoraproject.org ...
- 详解offset
offset offset 译为“偏移量”,是javascript很重要的一个概念.涉及到便宜量的主要有offsetLeft.offsetTop.offHeight.offsetWidth这四个属性还 ...
- 连接GitHub的方法
连接到GitHub 首先在本地创建 ssh key: ssh-keygen -t rsa -C "your_email@youremail.com" 后面的 your_email@ ...
- bzoj2501
题解: 显然,每当进入一个小的边界,那么我们的ans+1,出去一个大的边界,ans-1 然后,我们将每一个边界排序,时间小的在前,大的在后 每一次进来一个,如果是左边的边界,+1,右边的-1 然后输出 ...
- HDU 4549 M斐波那契数列(矩阵快速幂+费马小定理)
M斐波那契数列 Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other) Total Submi ...
- core文件介绍
原文链接:http://team.eyou.com/?p=27 如有侵犯您的版权,请联系windeal12@qq.com linux下,产生core文件,和不产生core文件的条件: 当我们的程序崩溃 ...
- TCP 初步认识
TCP连接的建立---三次握手 第一次握手:客户端TCP首先给服务器端TCP发送一个特殊的TCP数据段. 该数据段不包含应用层数据,并将头部中的SYN位设置为1,所以该数据段被称为SYN数据段. 另外 ...
- python3精简笔记(二)——函数
函数 下面的地址可以查看函数: https://docs.python.org/3/library/functions.html 也可以在交互式命令行通过help()查看函数的帮助信息. 如: > ...
- IOS开发 CocoaPods 使用 pod Install 出现 Updating local specs repositories
pod install 换成pod install --verbose --no-repo-update这个命令,前面的命令被墙了
- OpenFlow技术白皮书-V1.0
1. 概述 OpenFlow是由斯坦福大学的Nick McKeown教授在2008年4月ACM Communications Review上发表的一篇论文OpenFlow: enabling inn ...