location /
{
proxy_pass ;
proxy_set_header Host my.xoyo.com;
proxy_set_header X-Forward-For $remote_addr;
}
access_log /data1/logs/my.xoyo.com_access.log;
}
#图片服务器,不同的路径访问后端不同的服务器
server
{
listen 80;
server_name pic.xoyo.com;
location /cms/
{
proxy_pass ;
proxy_set_header Host pic.xoyo.com;
proxy_set_header X-Forward-For $remote_addr;
}
access_log /data1/logs/pic.xoyo.com_access.log;
}
#音频电台文件下载,进行简单防盗链
#limit_zone media %binary_remote_addr 10m;
server
{
listen 80;
server_name media.xoyo.com;
location /
{
proxy_pass ;
proxy_set_header Host $host;
proxy_set_header X-Forward-For $remote_addr;
valid_reference nine blocked *.xoyo.com *.kingsoft.com *.kingsoft.cn;
if ($invalid_referers){
rewrite ^/ ;
}
}
access_log /data1/logs/media.xoyo.com_access.log;
}
#“逍遥有聊”WebIM产品的负载均衡,反向代理两种HTTP服务器
server
{
listen 80;
server_name hi.xoyo.com;
#反向代理一款定制开发的高性能消息队列HTTP服务器
location /recmessage.xoyo
{
proxy_pass ;
proxy_set_header Host $host;
}
location /
{
proxy_pass ;
proxy_set_header Host $host;
proxy_set_header X-Forward-For $remote_addr;
}
access_log /data1/logs/hi.xoyo.com_access.log;
#论坛负载均衡并对图片、Flash、JavaScript、CSS、静态HTML进行Web缓存
server {
listen 80;
server_name bbs.xoyo.com *.bbs.xoyo.com bbs.xoyo.kingsoft.com;
location /
{
proxy_pass ;
proxy_set_header Host $host;
proxy_set_header X-Forward-For $remote_addr;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css|html|shtml)$
{
proxy_cache cache_one;
proxy_cache_valid 200 10m;
proxy_cache_valid 304 1m;
proxy_cache_valid 301 302 ih;
proxy_cache_valid any 1m;
proxy_cache_key $host$uri$is_args$args;
proxy_set_header Host $host;
proxy_set_header X-Forward-For $remote_addr;
proxy_pass ;
}
log_format bbs '$remote_addr $host $remote_user [$time_local] "$request"'
'"$status" $body_bytes_sent "$http_referer"'
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /data1/logs/bbs.xoyo.com_access.log bbs;
}
#论坛附件反向代理,限制下载速度为256k/秒
server{
listen 80;
server_name att03.bbs.xoyo.com att02.bbs.xoyo.com att01.bbs.xoyo.com;
location /{
#限制下载速度为256k/s
limit_rate 256k;
proxy_pass ;
proxy_set_header Host $host;
proxy_set_header X-Forward-For $remote_addr;
}
access_log off;
}
#逍遥江湖SNS社���,管理后台定位到一台服务器上,并对图片,flash,javascript,CSS进行web缓存
server
{
listen 80;
server_name hu.xoyo.com *.hu.xoyo.com;
location /
{