您的位置:首页 > 运维架构 > Nginx

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;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: