user www www;
worker_processes 4; error_log logs/error.log crit; pid logs/nginx.pid; worker_rlimit_nofile 51200; events { use epoll; worker_connections 51200; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; tcp_nodelay on; #----for self site(help and mail)---------------------------------------- server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 20m; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 128k; 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; #----------------------------------------------------------------------- # server pool upstream bspfrontsvr { server 192.168.1.12:80 weight=1; } upstream bspimgsvr { server 192.168.1.16:80 weight=1; } upstream bspstylesvr { server 192.168.1.18:80 weight=1; } upstream bspwsisvr { server 192.168.1.11:80 weight=1; } upstream bspadminsvr { server 192.168.1.14:80 weight=1; } upstream bspbuyersvr { server 192.168.1.17:80 weight=1; } upstream bspsellersvr { server 192.168.1.15:80 weight=1; } upstream bspregistersvr { server 192.168.1.13:80 weight=1; } upstream wwwolsvr { server 192.168.1.41:80 weight=1; } log_format foo_com '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; #-------------------------------------------------------------------- ###for self site #help. server { listen 192.168.1.30:80; server_name help.; index index.html index.htm index.php; root /data0/htdocs/help; #limit_conn crawler 20; location ~ .*\.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fcgi.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } access_log logs/help.log foo_com; error_page 500 502 503 504 404 /50x.html; location = /50x.html { root html; } } #mail. server { listen 192.168.1.30:80; listen 127.0.0.1:80; server_name mail.; index index.html index.htm index.php; root /data0/htdocs/mail; #limit_conn crawler 20; location ~ .*\.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fcgi.conf; } # location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ # { # expires 30d; # } location ~ .*\.(js|css)?$ { expires 1h; } #---------for awstats-------------------- location /awstats { root /usr/local/awstats/wwwroot/; auth_basic "admin"; auth_basic_user_file /usr/local/awstats/htpasswd.users; include awstats.conf; } #---------for nagios-------------------- location /nagios/ { alias /data0/htdocs/mail/nagios/share/; auth_basic "admin"; auth_basic_user_file /data0/htdocs/mail/nagios/etc/htpasswd.users; } location /nagios/cgi-bin/ { include nagios_cgi.conf; } access_log logs/mail.log foo_com; } ###reveres proxy server------------------------------------------------------- #img. server { listen 192.168.1.30:80; server_name img.; location / { proxy_pass http://bspimgsvr; include proxy_setting.conf; } access_log logs/img.log foo_com; } #style. server { listen 192.168.1.30:80; server_name style.; location / { proxy_pass http://bspstylesvr; include proxy_setting.conf; } access_log logs/style.log foo_com; } #admin. server { listen 192.168.1.30:80; server_name admin.; location / { proxy_pass http://bspadminsvr; include proxy_setting.conf; } access_log logs/admin.log foo_com; } #buyer. server { listen 192.168.1.30:80; server_name buyer.; location / { proxy_pass http://bspbuyersvr; include proxy_setting.conf; } access_log logs/buyer.log foo_com; } #seller. server { listen 192.168.1.30:80; server_name seller.; location / { proxy_pass http://bspsellersvr; include proxy_setting.conf; } access_log logs/seller.log foo_com; } #wsi. server { listen 192.168.1.30:80; server_name wsi.; location / { proxy_pass http://bspwsisvr; #include proxy_setting.conf; } access_log logs/wsi.log foo_com; } #*. www. server { listen 192.168.1.30:80; server_name www. *. ; location ~ ^/NginxStatus/ { stub_status on; access_log off; } location / { proxy_pass http://bspfrontsvr; include proxy_setting.conf; } access_log logs/www.log foo_com; error_page 500 502 503 504 404 /50x.html; location = /50x.html { root html; } } #login. for register server { listen 192.168.1.30:80; server_name login.; location / { proxy_pass http://bspregistersvr; include proxy_setting.conf; } access_log logs/register.log foo_com; } } |
|