nginx 根据参数选择文档根目录
2015-12-11 15:27
225 查看
server
{
listen 80;
server_name testmanage.h5.91wan.com;
index index.html index.htm index.php;
#char szArgs[URI_LEN + 1] = {0};
#echo memcpy(szArgs, r->args.data, r->args.len);
#$arg_a;
set $website $arg_version;
root /data/www/h5.91wan.com/$website;
#limit_conn crawler 20;
# location /nginx_status {
# stub_status on;
# access_log off;
# }
location ~ .*\.(php|php5)?$
{
if ( $fastcgi_script_name ~ \..*\/.*php ) {
return 403;
}
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /usr/local/nginx/conf/fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 6h;
#access_log /www/logs/img.chinaih.com.log;
}
location ~ .*\.(js)?$
{
expires 5m;
}
location ~ .*\.(css)?$
{
expires 1h;
}
access_log off;
}
{
listen 80;
server_name testmanage.h5.91wan.com;
index index.html index.htm index.php;
#char szArgs[URI_LEN + 1] = {0};
#echo memcpy(szArgs, r->args.data, r->args.len);
#$arg_a;
set $website $arg_version;
root /data/www/h5.91wan.com/$website;
#limit_conn crawler 20;
# location /nginx_status {
# stub_status on;
# access_log off;
# }
location ~ .*\.(php|php5)?$
{
if ( $fastcgi_script_name ~ \..*\/.*php ) {
return 403;
}
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /usr/local/nginx/conf/fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 6h;
#access_log /www/logs/img.chinaih.com.log;
}
location ~ .*\.(js)?$
{
expires 5m;
}
location ~ .*\.(css)?$
{
expires 1h;
}
access_log off;
}
相关文章推荐
- Linux下安装Nginx详细图解教程
- 【nginx配置】nginx做非80端口转发
- Nginx 的启动、停止
- nginx 变量
- nginx 的安装
- linux 安装nginx
- nginx 的安装
- nginx配置详解
- nginx秒退
- Nginx封鎖空User Agent訪問
- windows下设置Nginx开机自动启动
- nginx,搭建负载均衡
- (总结)Nginx配置文件nginx.conf中文详解
- nginx 502错误 upstream sent too big header while reading response header from upstream
- nginx--rewrite指令使用
- nginx location
- 安装linux学习六(1):centos安装nginx
- centos nginx和svn开机自启动
- 利用python分析nginx日志
- 清除nginx静态资源缓存