#user nobody;
worker_processes 2;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
client_max_body_size 300m;
fastcgi_buffers 8 128k;
send_timeout 3600;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css
application/xml;
gzip_vary on;
upstream server_tomcat81{
server ip:81;
}
upstream server_tomcat82{
server ip:82;
}
upstream server_tomcat83{
server ip:83;
}
server {
large_client_header_buffers 4 160k;
client_max_body_size 30m;
client_body_buffer_size 128k;
proxy_connect_timeout 30000;
proxy_read_timeout 3000;
proxy_send_timeout 3000;
proxy_buffer_size 64k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
listen 80;
server_name 域名;
location / {
proxy_pass http://server_tomcat81;
index login.jsp;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
large_client_header_buffers 4 160k;
client_max_body_size 30m;
client_body_buffer_size 128k;
proxy_connect_timeout 3000;
proxy_read_timeout 3000;
proxy_send_timeout 3000;
proxy_buffer_size 64k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
listen 80;
server_name 域名;
location / {
proxy_pass http://server_tomcat82;
index index.html index.htm login.jsp;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 80;
large_client_header_buffers 4 160k;
client_max_body_size 30m;
client_body_buffer_size 128k;
proxy_connect_timeout 3000;
proxy_read_timeout 3000;
proxy_send_timeout 3000;
proxy_buffer_size 64k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
server_name 域名;
location / {
proxy_pass http://server_tomcat83;
index index.html index.htm login.jsp;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
作者:候鸟 出处:http://www.cnblogs.com/swite/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 如果文中有什么错误,欢迎指出。以免更多的人被误导。 |