|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
小知识:Linux继承了Unix以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统。
nginx.conf设置装备摆设文件:
usernobodynobody;
worker_processes4;
error_loglogs/error.logcrit;
pidlogs/nginx.pid;
worker_rlimit_nofile65535;
events{
useepoll;
worker_connections65535;
}
http{
server_tokensoff;
includemime.types;
default_typeapplication/octet-stream;
server_names_hash_bucket_size128;
sendfileon;
tcp_nopushon;
tcp_nodelayon;
keepalive_timeout65;
gzipon;
gzip_min_length1k;
gzip_buffers416k;
gzip_http_version1.0;
gzip_comp_level2;
gzip_typestext/plainapplication/x-javascripttext/CSSapplication/xml;
gzip_varyon;
upstreammysrv{
server192.168.1.1:80weight=1max_fails=2fail_timeout=30s;
server192.168.1.2:80weight=1max_fails=2fail_timeout=30s;
}
upstreambench{
server192.168.1.3:80weight=1max_fails=2fail_timeout=30s;
server192.168.1.4:80weight=1max_fails=2fail_timeout=30s;
}
upstreambbs{
server192.168.1.5:80weight=1max_fails=2fail_timeout=30s;
server192.168.1.6:80weight=1max_fails=2fail_timeout=30s;
}
includevhost/*.conf;
}
aaa_example_com.conf设置装备摆设文件:
server{
listen80;
server_nameaaa.example.com;
indexindex.phpindex.htmlindex.htmindex.shtml;
log_formatproxy$remote_addr|$upstream_addr|$connection|$upstream_status|$time_local|$request|
$status|$body_bytes_sent|$bytes_sent|$http_referer|
$http_user_agent|$upstream_response_time|$msec|$request_time;
access_loglogs/aaa_access.logproxy;
location/{
proxy_passhttp://mysrv;
includeproxy.conf;
}
location/bench/{
proxy_passhttp://bench;
includeproxy.conf;
}
}
bbs_example_com.conf设置装备摆设文件:
server{
listen80;
server_namebbs.example.com*.bbs.example.com;
log_formatproxy$remote_addr|$upstream_addr|$connection|$upstream_status|$time_local|$request|
$status|$body_bytes_sent|$bytes_sent|$http_referer|
$http_user_agent|$upstream_response_time|$msec|$request_time;
access_loglogs/bbs_access.logproxy;
location/{
proxy_passhttp://bbs;
includeproxy.conf;
}
}
proxy.conf设置装备摆设文件:
proxy_redirectoff;
proxy_set_headerHost$host;
proxy_set_headerX-Real-IP$remote_addr;
proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;
client_max_body_size50m;//许可客户端要求的最年夜单个文件字节数
client_body_buffer_size256k;//缓冲区署理缓冲客户端要求的最年夜字节数
proxy_connect_timeout30;//衔接后端办事器超不时间
proxy_send_timeout30;//后端办事器发送数据超不时间
proxy_read_timeout60;//后端办事器呼应要求超不时间
proxy_buffer_size4k;//署理要求缓存区巨细
proxy_buffers432k;
proxy_busy_buffers_size64k;//体系忙碌时可请求的proxy_buffers巨细
proxy_temp_file_write_size64k;//proxy缓存暂时文件的巨细
proxy_next_upstreamerrortimeoutinvalid_headerhttp_500http_503http_404;//毛病转移
proxy_max_temp_file_size128m;
proxy_set_header指令用于在向反向署理的后端web办事器提议要求时添加指定Header头信息,当后端web办事器上有多个基于域名的虚拟主机时,要经由过程添加Header头信息Host,来指定要求的域名,如许后端web办事器能力辨认该反向署理拜访要求由哪一个虚拟主机来处置。
小知识:CentOS在服务器提供商、中小型公司中装机量几乎是最大的Linux发行版。 |
|