利用nginx+tomcat+memcached组建web服务器负载均衡(3)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-06 08:45 点击:次
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
proxy_buffer_size 16k;
proxy_buffers 4 32k;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Connection Close;
server_names_hash_max_size 1024;
server_names_hash_bucket_size 1024;
# Default cache parameters for use by virtual hosts
# Set the cache path to tmpfs mounted disk, and the zone name
# Set the maximum size of the on disk cache to less than the tmpfs file system size
proxy_cache_path ./cache levels=1:2 keys_zone=pscms:100m max_size=800m;
proxy_temp_path ./proxy;
#配置后端服务器信息
upstream web_server {
#ip_hash;
server localhost:8080 max_fails=3 fail_timeout=30s;
server localhost:8180 max_fails=3 fail_timeout=30s;
}
server {
listen 8888; ## listen for ipv4
#listen [::]:80 default ipv6only=on; ## listen for ipv6
server_name localhost;
charset utf-8;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/host.access.log main;
#access_log off;
location ~ .*\.(jsp|action)?$ {
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://web_server;
相关新闻>>
- 发表评论
-
- 最新评论 更多>>