nginx配置_仅参考
程序员文章站
2024-03-21 14:53:28
...
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;
}
}
上一篇: 初体验
推荐阅读
-
nginx配置_仅参考
-
配置_DruidDataSource参考配置
-
nginx配置参考
-
nginx同一iP多域名配置方法 博客分类: vb2005xu开发文章转摘 nginx
-
如何用nginx+passenger部署Rails(转) 博客分类: rails nginxRailsrubygems配置管理Apache
-
nginx配置访问密码,输入用户名和密码才能访问
-
nginx配置目录访问&用户名密码控制
-
windows下Nginx+tomcat实现负载均衡 博客分类: 负载均衡 负载均衡配置
-
windows下Nginx+tomcat实现负载均衡 博客分类: 负载均衡 负载均衡配置
-
nginx缓存模块ngx_cache_purge配置 博客分类: nginx cachenginx