nginx 配置文件

#user  nginx;
worker_processes  4;

error_log  logs/error.log;
error_log  logs/error.log  notice;
error_log  logs/error.log  info;
pid        logs/nginx.pid;

worker_rlimit_nofile 65535;

events {
   use epoll;
   worker_connections  3000;
}

http {

    include       mime.types;
    default_type  application/octet-stream;

    log_format main  '$remote_addr- $remote_user [$time_iso8601] $status '
                        '"$request" $body_bytes_sent "$http_referer" '
                        '"$http_user_agent" $proxy_add_x_forwarded_for "$upstream_addr" "$request_time" - "$http_version"';

    server_names_hash_bucket_size 128;
    client_header_buffer_size 32k;
    large_client_header_buffers   4 32k;

    gzip on;
    gzip_min_length   1k;
    gzip_buffers 4 16k;
    gzip_comp_level 2;
    gzip_http_version 1.1;
    gzip_types    text/plain text/css application/xml application/x-javascript;

    #access_log   /var/log/nginx/access.log main;
    access_log off;

    client_header_timeout   3m;
    client_body_timeout 3m;
    send_timeout       3m;
    sendfile             on;
    tcp_nopush              on;
    tcp_nodelay          on;
    keepalive_timeout   65;

    client_max_body_size 50m;
    client_body_buffer_size 256k;

    proxy_connect_timeout 300s;
    proxy_read_timeout 300s;
    proxy_send_timeout 300s;

    proxy_buffer_size 128k;
    proxy_buffers 8 128k;
    proxy_busy_buffers_size 256k;

    proxy_temp_file_write_size 128k;
    proxy_max_temp_file_size 128m;

    server_tokens off;

    #负载均衡服务器池
    upstream commentServiceServer {
		server 100.150.30.202:8088;
        server 100.150.30.203:8088;
		server 100.150.30.204:8088;
    }
	
	upstream commentwebServer {
		server 100.150.30.200:8088;
    }

    server {
	        listen       80;
	        #nginx 服务器所在IP,也可以配置域名
	        server_name  100.150.30.200;
	
			#代理转发
			location /commentweb {
			     proxy_pass http://commentwebServer;
			}
		
			location /comment_service {
			     proxy_pass http://commentServiceServer;
			}
		
		
			access_log  /home/nginx/logs/access.log  main;
			open_log_file_cache max=1000 inactive=20s min_uses=1 valid=60s;
    }

    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

你可能感兴趣的:(nginx)