nginx下配置多站点
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx下配置多站点相关的知识,希望对你有一定的参考价值。
http://www.linuxidc.com/Linux/2011-07/38125.htm
img.xxxx.com
nginx configTest
add_header Access-Control-Allow-Origin *;
log_format zuren ‘$remote_addr - $remote_user [$time_local] ‘
‘$request_time $upstream_response_time "$request" ‘
‘$status $body_bytes_sent "$http_referer" ‘
‘"$http_user_agent" "$http_x_forwarded_for"‘;
server{
listen 80;
server_name img.xxxx.com;
index index.php;
root /data/www/img;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}
location /.git {
deny all;
return 403;
}
location ~ .*\.php[/]?
{
include php_fcgi.conf;
include pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
access_log /var/log/nginx/img.log zuren;
# access_log off;
}
本文出自 “枷罗博客” 博客,请务必保留此出处http://jhomephper.blog.51cto.com/8558055/1746830
以上是关于nginx下配置多站点的主要内容,如果未能解决你的问题,请参考以下文章