worker_connections 1024;
}
http
{
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
upstream linuxidc
{
server 192.168.234.160:5001 max_fails=3 fail_timeout=3s weight=9;
server 192.168.234.161:5001 max_fails=3 fail_timeout=3s weight=9;
}
server
{
listen 8001;
server_name localhost;
location /
{
root html;
index index.html index.htm;
proxy_pass http://linuxidc;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
upstream linuxidc2
{
server 192.168.234.160:5002 max_fails=3 fail_timeout=3s weight=9;
server 192.168.234.161:5002 max_fails=3 fail_timeout=3s weight=9;
}
server
{
listen 8002;
server_name localhost2;
location /
{
root html;
index index.html index.htm;
proxy_pass http://linuxidc2;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
upstream JmCityWeb {
server 192.168.111.128:5001 max_fails=3 fail_timeout=3s weight=9;
server 192.168.111.129:5001 max_fails=3 fail_timeout=3s weight=9;
}
server
{
listen 8001;
server_name nginxcityweb;
charset utf-8;
index index.html index.htm;
root /data0/htdocs/www;#没有站点暂时可以不用管这些
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 50m;
client_body_buffer_size 256k;
proxy_connect_timeout 30;
proxy_send_timeout 30;
proxy_read_timeout 60;
proxy_buffer_size 256k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
proxy_max_temp_file_size 128m;
proxy_pass http://JmCityWeb;
}
}