user root; worker_processes 1; error_log /var/log_dsl/nginx/error.log warn; #error_log logs/error.log notice; #error_log logs/error.log info; #pid /var/run/nginx.pid; events { worker_connections 65535; } http { include mime.types; default_type application/octet-stream; upstream audio.hd { server 192.168.130.253:9801 weight=1; # 权重轮询方式 server 192.168.130.253:9800 weight=1; } upstream audio.qd { server 192.168.130.253:9111 weight=1; # 权重轮询方式 server 192.168.130.253:9000 weight=1; } log_format main '$remote_addr $http_x_forwarded_for $remote_user $time_local $host $request $request_length $request_body $status $body_bytes_sent $bytes_sent $content_type $http_referer $http_user_agent $http_cookie $upstream_status $upstream_addr $request_time $upstream_response_time pachira_nginx'; access_log /var/log_dsl/nginx/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 100; gzip on; #低于1kb的资源不压缩 gzip_min_length 1k; #压缩级别1-9,越大压缩率越高,同时消耗cpu资源也越多,建议设>置在5左右。 gzip_comp_level 3; #需要压缩哪些响应类型的资源,多个空格隔开。不建议压缩图片. gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css; #配置禁用gzip条件,支持正则。此处表示ie6及以下不启用gzip(因为ie低版本不支持) gzip_disable "MSIE [1-6]\."; #是否添加“Vary: Accept-Encoding”响应头 gzip_vary off; #gzip_types text/plain application/json application/x-javascript application/css application/xml application/xml+rss text/javascript application/x-httpd-php image/jpeg image/gif image/png image/jpg image/x-ms-bmp; types_hash_max_size 2048; client_max_body_size 100m; client_header_buffer_size 4096k; large_client_header_buffers 16 4096k; chunked_transfer_encoding on; include /etc/nginx/conf.d/*.conf; server { listen 6868; server_name localhost; #charset koi8-r; # access_log logs/host.access.log main; location /DMService { #root /data/dengyuanjing/audio/web/voiceSplicingWeb/; #index index.html; proxy_pass http://audio.hd/DMService; } # error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # 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; # } #} }