location alias与root
2016-08-03 00:16
330 查看
网站的根目录是:/alidata/www/webtest
上图的语法应该是有问题的:
[root@M webtest]# tree /alidata/www/ /alidata/www/ ├── abc.html └── webtest ├── ck │ └── 123 │ └── index.php └── index.php 3 directories, 3 files
[root@M webtest]# cat /alidata/server/nginx/conf/vhosts/webtest.conf server { listen 80; server_name localhost; index index.php index.htm index.html; root /alidata/www/webtest; location /abc/ { alias /alidata/www/; #实际访问的是/alidata/www/,也就是说alias指的是要访问的目录,而root是指要访问的目录的上一个目录 #root /alidata/www/; #实际访问的是/alidata/www/abc/ } location ~ .*\.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } include /alidata/server/nginx/conf/rewrite/webtest.conf; access_log /alidata/log/nginx/access/webtest.log; }
上图的语法应该是有问题的:
改成 location /awstats/ 或 location ^~ /awstats/
相关文章推荐
- gitlab安装 vmware ubuntu16 linux 虚拟机 dns无法解析
- AsyncTask异步从网上下载图片
- js笔记整理02
- 大数据IMF传奇行动绝密课程第20课:Top N彻底解秘
- [BZOJ4513] [SDOI2016] 储能表 - 数位DP
- 树的直径学习总结
- ace在linux下编译
- am命令启动Acitivity流程图
- 陶伯定理(Tauber theorem)
- python_django 返回和 通用视图
- Retrofit2 完全解析 探索与okhttp之间的关系
- 关于水平居中,垂直居中的三种办法
- 【一步一步学习VBA】VBA获取单元格数值并弹窗显示
- 网站从http过度到https需要注意的几个小问题
- iBATIS入门之安装配置与简单测试
- CodeForces 702E Analysis of Pathes in Functional Graph(倍增)
- [hdu 2068 RPG的错排] 错排公式
- BZOJ2243 (树链剖分+线段树)
- 2017年搜狐内推 面试题——谈谈面试中的算法
- 两种计算器的实现方式