nginx配置_仅参考


cat laifeng_newlog.conf
log_format laifeng_newlog_main '$http_x_forwarded_for $time_local $request $status $http_user_agent $http_x_forwarded_for $request_time $connection $http_referer';

server {
listen 80;
server_name log.laifeng.com;

location /log/client {
default_type "text/html";
content_by_lua_file /opt/lua/content.lua;
access_log /opt/logs/nginx/access/laifeng_newlog.log laifeng_newlog_main;
}

client_max_body_size 10M;

location ~ ^/logger.jsp {
return 404;
access_log off;
}

location = /v1/gift/show_resources {
return 404;
access_log off;
}

location = /v1/sdk/level/user {
return 404;
access_log off;
}

location = /v1/sdk/level/anchor {
return 404;
access_log off;
}

location = /v1/sdk/gift/get {
return 404;
access_log off;
}

location = /v1/sdk/gift/sign {
return 404;
access_log off;
}

}



upstream log_laifeng_com {
# hash $http_x_forwarded_for;
server 10.100.20.25:8083 max_fails=3 fail_timeout=30s;
server 10.100.20.26:8083 max_fails=3 fail_timeout=30s;
}

#upstream BIND_laifeng_com {
# hash $http_x_forwarded_for;
# server 10.100.20.25:8082 max_fails=3 fail_timeout=30s;
# server 10.100.20.26:8082 max_fails=3 fail_timeout=30s;
# }


log_format laifeng_log_main '$http_x_forwarded_for $time_local $request $status $http_user_agent $http_x_forwarded_for $request_time $connection $http_referer';

server {
listen 80;
server_name log.laifeng.com;

#location = /lvs/lvs.html {
# default_type "text/html;charset=UTF-8";
# return 200 "Hello World";
#}

client_max_body_size 10M;

location ~ ^/logger.jsp {
return 404;
access_log off;
}

location = /v1/gift/show_resources {
return 404;
access_log off;
}

location = /v1/sdk/level/user {
return 404;
access_log off;
}

location = /v1/sdk/level/anchor {
return 404;
access_log off;
}

location = /v1/sdk/gift/get {
return 404;
access_log off;
}

location = /v1/sdk/gift/sign {
return 404;
access_log off;
}

###################### 2015-07-11/活动应急备用 ######################
# location = /redirect.html {
# if ( $request_uri ~ "/(.*).html\?id=(000145d3|000145d0|000145d4|000145d5)$" )
# {
# rewrite ^/(.*) http://www.laifeng.com/lizhiting? redirect;
# }
# proxy_next_upstream http_502 http_504 error timeout invalid_header;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_pass http://cps.laifeng.com;
# access_log /opt/logs/nginx/access/laifeng_cps.log laifeng_cps_main;
# }

####################### 2015-08-06 #########################
# location /bind {
# proxy_next_upstream http_502 http_504 error timeout invalid_header;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_pass http://BIND_laifeng_com;
# access_log /opt/logs/nginx/access/laifeng_cps.log laifeng_cps_main;
# }

location / {
proxy_next_upstream http_502 http_504 error timeout invalid_header;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://log_laifeng_com;
access_log /opt/logs/nginx/access/laifeng_log.log laifeng_log_main;
}
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值