时间:2021-07-01 10:21:17 帮助过:2人阅读
worker_processes 3; //cpu内核数目-1 ,使用下来效果较好
#worker_processes 4;#worker_cpu_affinity 0001 0010 0100 1000;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;events {
use epoll;
worker_connections 8192;
}
http {
include mime.types;
default_type application/octet-stream;
server_tokens off;
keepalive_timeout 6020;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
client_header_buffer_size 16k;
large_client_header_buffers 4 32k;
server_names_hash_max_size 512;
server_names_hash_bucket_size 64;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
limit_req_zone $binary_remote_addr z rate=10r/s;
limit_req_zone $http_user_agent z rate=10r/s;
log_format oschina_log
'$remote_addr - $remote_user [$time_local] $request ''"$status" $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/joinku.log;
#开启zip网页压缩
gzip on;
gzip_min_length 1k;
gzip_buffers 4 8k;
gzip_http_version 1.1;
gzip_types text/plain application/x-javascript text/css application/xml;
...
}
以上就介绍了welcome to nginx 生产环境下 nginx 和 tomcat的调优,包括了welcome to nginx方面的内容,希望对PHP教程有兴趣的朋友有所帮助。