
利用Nginx
反向代理原理,实现集群
服务器瞬间故障转移,看用于生产环境中综合设置的例子:#注:proxy_temp_path和proxy_cache_path指定的路径必须在同一分区proxy_temp_path/data0/proxy_temp_dir;#设置Web
缓存区名称为cache_one,内存缓存空间大小为200MB,1天没有被访问的内容自动清除,硬盘缓存空间大小为30GB。proxy_cache_path/data0/proxy_cache_dirlevels=1:2keys_zone=cache_one:200minactive=1dmax_size=30g;#轮询服务器,weight为服务器权重,与访问频率成正比,max_fails最大超时次数,fail_timeout服务器代理监听超时时间upstreambackend_server{server19216820343:80weight=1max_fails=2fail_timeout=30s;server19216820344:80weight=1max_fails=2fail_timeout=30s;server19216820345:80weight=1max_fails=2fail_timeout=30s;}server{listen80;server_name19216820342;indexindexhtmlindexhtm;root/data0/htdocs/>
评论列表(0条)