# written by fingerecho on 2019/05/28 user www www; worker_processes 2; error_log /var/log/tengine/error.log; pid /usr/local/tengine/pidder/tengine.pid; worker_rlimit_nofile 65535; events { use epoll; worker_connections 1024; } # load modules compiled as Dynamic Shared Object (DSO) # #dso { # load ngx_http_fastcgi_module.so; # load ngx_http_rewrite_module.so; #} http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; #keepalive_timeout 0; keepalive_timeout 30; client_header_timeout 10; client_body_timeout 10; gzip on; ############## gzip_min_length 1k; #设置允许压缩的页面最小字节数。 gzip_buffers 4 16k; #用来存储gzip的压缩结果 gzip_http_version 1.1; #识别HTTP协议版本 gzip_comp_level 2; #设置gzip的压缩比 1-9 1压缩比最小但最快 9相反 gzip_types text/plain application/x-javascript text/css application/xml; #指定压缩类型 gzip_proxied any; #无论后端服务器的headers头返回什么信息,都无条件启用压缩 gzip_vary on; gzip_disable "MSIE [1-6]."; #禁用IE6的gzip压缩 ############### # proxy config ############# proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_body_buffer_size 512k; proxy_connect_timeout 30; proxy_read_timeout 30; proxy_send_timeout 30; proxy_buffer_size 32k; proxy_buffers 4 64k; proxy_busy_buffers_size 128k; ###################### log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; include /usr/local/tengine/conf/conf.d/*.conf; }