tengine缓存服务器配置

  

官方文档 http://tengine.taobao.org/

tengine主配置文件

cat /usr/local/nginx/conf/nginx.conf

user  nobody nobody;

worker_processes  8;

#error_log  /www/nginx/logs/nginx_debug.log  debug_http;
error_log   /www/nginx/logs/nginx_error.log error;
#error_log  /www/nginx/logs/nginx_notice.log  notice;
#error_log  /www/nginx/logs/nginx_info.log  info;

pid        /var/run/nginx.pid;

worker_rlimit_nofile 102400;

events {
    use epoll;
    worker_connections  102400;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘
    #                  ‘$status $body_bytes_sent "$http_referer" ‘
    #                  ‘"$http_user_agent" "$http_x_forwarded_for"‘;

    # log_format for base_nginx_log
    log_format base_nginx_log  ‘ $remote_addr - $remote_user [$time_local] $msec ‘
                         ‘ $host $request $status $http_accept_encoding $body_bytes_sent $http_referer $http_user_agent ‘
                         ‘ $http_cookie $upstream_addr $upstream_response_time $request_time $connection_requests $upstream_cache_status ‘
;
    #access_log  logs/access.log  main;

    server_names_hash_bucket_size 512;

    client_header_buffer_size 32k;
    large_client_header_buffers 8 32k;
    client_max_body_size 100m;
    client_body_buffer_size 128k;
    client_body_temp_path  /lvm_cache/nginx/client_temp 1 2;

    sendfile        on;
    tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    tcp_nodelay on;
    server_tokens off;
    server_tag nginx;
    index index.html index.htm index.jsp;
    add_header X-UA-Compatible "IE=EmulateIE7";
#    add_header X-Cache ‘$upstream_cache_status‘;

    open_file_cache max=102400 inactive=20s;
    open_file_cache_valid 30s;
    open_file_cache_min_uses 1;

    ####### begin gzip #######
    gzip off;
    gzip_min_length  100;
    gzip_buffers     64 32k;
    gzip_http_version 1.1;
    gzip_proxied any;
    gzip_comp_level 9;
    gzip_types       text/plain text/css text/xml application/xml text/javascript application/x-javascript application/json;
    gzip_vary on;
    ####### end gzip #######

    #######begin proxy #######
    proxy_redirect off;
    proxy_connect_timeout 15;
    proxy_send_timeout 60;
    proxy_read_timeout 60;

    proxy_buffer_size 64k;
    proxy_buffers 32 64k;
    proxy_busy_buffers_size 64k;

    proxy_temp_file_write_size 512k;
    proxy_temp_path /lvm_cache/nginx/proxy_temp;
    proxy_pass_header  Set-Cookie;
    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_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_404;
    #fastcgi_next_upstream error timeout invalid_header http_500 http_503 http_404;

    proxy_next_upstream error timeout http_500 http_502 http_503 http_504;
    proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504 http_404;
    proxy_cache_path  /lvm_cache/nginx/cache_test levels=1:2 keys_zone=cache_test:100m inactive=1d max_size=300m;

    #gzip  on;

    # 

    server {

        listen       88;

        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache‘s document root
        # concurs with nginx‘s one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

    server {

        listen 10.10.10.10:88;

        server_name  10.10.10.10;

        location ^~ /nginx_status {
            stub_status on;

        }

        location ^~ /cluster_status {
            check_status;
            access_log off;
            allow 10.10.10.10;
            allow 10.10.10.0/28;
            deny all;
        }

#      location ^~ /httpcode_status {
#          show_status_code_count on;
#
#      }

#      location ^~/ttlsa-req-status {
#          req_status_show;
#
#      }

      location ~ /purge(/.*) {
          #allow 10.10.10.20;
          #deny        all;
          proxy_cache_purge cache_test $http_referer$1$is_args$args;
      }

      location ~ /purge_test(/.*) {
          proxy_cache_purge cache_test $http_referer$1$is_args$args;
      }

      access_log off;

    }

    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}
    #include /usr/local/nginx/conf/cluster.conf;
    include /usr/local/nginx/conf/cluster/*.conf;
    include /usr/local/nginx/conf/include/*.conf;

}

  

时间: 2024-08-25 20:56:29

tengine缓存服务器配置的相关文章

3.BIND从服务器及缓存服务器配置

一.域从服务器 一个域的从服务器(slave)通常是为了备份及负载均衡使用,所有这个域的信息都是由域的主服务器控制,域slave服务器启动时会从域的主服务器(master)上抓取指定域的zone配置文件,域slave服务器的配置如下: 1.在bind的主配置文件中添加该域的定义 2.启动bind服务或使bind刷新配置 3.查看域的zone文件是否正常抓取到/var/named/slaves目录中 4.使用host或dig命令检测域信息是否正常 二.域从服务器 linuxcast.net.zon

Linux下提供DNS缓存服务的bind应用的相关配置缓存

DNS(Domain Name System,域名系统),因特网上作为域名和IP地址相互映射的一个分布式数据库,能够使用户更方便的访问互联网,而不用去记住能够被机器直接读取的IP数串.通过主机名,最终得到该主机名对应的IP地址的过程叫做域名解析(或主机名解析).DNS协议运行在UDP协议之上,使用端口号53. Linux系统提供DNS服务,需要安装bind应用.以下详细说明: 安装配置的准备工作:两台相同版本的Linux虚拟主机.yum安装相同版本的bind应用 我的两台虚拟机地址: 192.1

Redis 作为缓存服务器的配置

随着redis的发展,越来越多的架构用它取代了memcached作为缓存服务器的角色,它有几个很突出的特点:1. 除了Hash,还提供了Sorted Set, List等数据结构2. 可以持久化到磁盘3. 支持cluster (3.0) 它的性能和memcached不相上下,再加上流行的其他组件(比如队列)也会用到redis,从架构简单出发,已经没有必要混用redis和memcached了. 写篇短文介绍一下用redis作为缓存服务器配置时候需要注意几个点. Redis配置 作为缓存服务器,如果

用nginx图片缓存服务器

用nginx图片缓存服务器 图片的存储硬件 把图片存储到什么介质上? 如果有足够的资金购买专用的图片服务器硬件或者 NAS 设备,那么简单的很: 如果上述条件不具备,只想在普通的硬盘上存储,首先还是要考虑一下物理硬盘的实际处理能力.是 7200 转的还是 15000 转的,实际表现差别就很大.是选择 ReiserFS 还是 Ext3 ,怎么也要测试一下吧? 创建文件系统的时候 Inode 问题也要加以考虑,选择合适大小的 inode size ,在空间和速度上做取舍,同时防患于未然,注意单个文件

DNS BIND配置 配置基本缓存服务器 DNS正向解析 DNS反向解析

一. 缓存服务器配置 1.DNS:BIND    Berkeley Internet Name Domain    版本bind97: RPM服务器端包的名字  安装bind-libs    bind-utils    配置文件 /etc/named.conf        BIND进程的工作属性        区域的定义     rndc: Remote Name Domain Controller        密钥文件 /etc/rndc.key        配置信息:/etc/rndc

各大电商的缓存策略

各大页面不为人知的"秘密"--管中窥豹看看各大电商如何做架构,如何做缓存的.    @原数据 淘宝  首页缓存1小时,用Tengine Web服务 亚马逊   居然...不缓存?? 京东  首页缓存2分钟,产品页缓存5分钟.JDWS 自己的服务中间件?还是只是...改个名... 首页 产品详情页 苏宁 首页缓存1个小时  真是和京东好基友,自定义"SNWS"? 产品页看样子还没去IBM... channel页面 产品详情页 当当  缓存策略不详,PHP裸奔?可能是n

CentOS7.4搭建DNS缓存服务器和转发器(四)

(一)简述一,DNS缓存服务器:DNS缓存服务器,即用来存储计算机网络上的用户需要的网页.文件等信息的专用服务器.这种服务器不仅可以使用户得到他们想要的信息,而且可以减少网络的交换量.缓存服务器往往也是代理服务器.由解析器和域名服务器组成的,用于TCP/IP网络.一个dns服务器可以既不是某个域的master服务器,也不是某个域的slave服务器,一个服务器可以不包含任何域的配置信息,它将接收到的所有dns查询进行递归解析,将解析结果返回给查询客户端,并且将查询结果缓存下来,这样的dns服务器称

负载均衡与缓存

 反向代理? 反向代理服务器配置nginx.conf #配置域名为test.web1.test的虚拟主机 server{ listen 80; server_name test.web1.test; #域名test.web1.test的请求全部转发到Web服务器192.168.1.101 location / { proxy_pass http://192.168.1.101; } } #配置域名为test.web2.test的虚拟主机 server{ listen 80; server_na

Nginx与MogileFS架构图片服务器实例

利用Nginx和MogileFS架构图片服务器 在之前的文章中以介绍如何搭建MogileFS:这里就不提了. 一,Nginx安装 在标准的nginx安装中增加支持MogileFS的模块,vkholodkov-nginx-mogilefs-module-249f2b0Nginx的配置mogilefs_pass [<key>] {<fetch block>} 使用范围:server,location,limit_except向MogileFS tracker查找URI中指定的关键字,关