Nginx.conf Configuration explanation
Detailed user www www; Define the Nginx running user and group Worker_processes 8; #[Debug | info | notice | warn | error | crit] Error_log/data1/logs/nginx_error.log crit; Pid/usr/local/webserver/nginx/nginx.pid;
#Specifies the value for maximum file descriptors the can is opened by this process.
Worker_rlimit_nofile 65535;
The maximum number of file descriptors that a nginx process opens, the theoretical value should be divided by the number of open files (ulimit-n) Nginx processes, and the Nginx allocation request is not so homogeneous, so it is best to be consistent with the Ulimit-n value.
# Use [kqueue | rtsig | epoll |/dev/poll | poll]; Events use Epoll; Reference event model Worker_connections 65535; Maximum number of connections per process (maximum connection = number of connections x processes) #设定 HTTP server http include mime.types; File name extension and file type mapping table Default_type Application/octet-stream; #默认文件类型 #charset gb2312; Default encoding server_names_hash_bucket_size 128; #服务器名字的 hash Table size Client_header_buffer_size 32k; Upload file size limit large_client_header_buffers 4 32k; Set request slow client_max_body_size 8m; Set request slow sendfile on; #开启高效文件传输模式 Tcp_nopush on; Prevent network blocking tcp_nodelay on; Preventing Network Congestion KeePalive_timeout 60; The timeout #FastCGI is to improve the performance of the site-reduce resource consumption and improve access speed. For more information on FastCGI see: http://www.fastcgi.com fastcgi_connect_timeout 30
0;
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; #压缩版本 (default 1.1, front end for squid2.5 using 1.0 gzip_comp_level 2; compression level gzip_types Text/plain application/x-javascript text/c
SS Application/xml;
Compression type, the default is already included text/html so there is no need to write, of course, there will be no problem, but there will be a warn gzip_vary on; #limit_zone crawler $binary _remote_addr 10m;
Server Listen 80;
server_name www.opendoc.com.cn index index.html index.htm index.php;
Root/data0/htdocs/opendoc; Location ~. *\.
(PHP|PHP5) $ #fastcgi_pass unix:/tmp/php-cgi.sock;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php; Includefcgi.conf; #对图片缓存 Location ~ *\. (gif|jpg|jpeg|png|bmp|swf) $ expires 30d; #对 JS CSS Cache location ~. *\. (JS|CSS) $ expires 1h; #日志设定 log_format access ' $remote _addr-$remote _user [$time _local] "$request" "$status $body _bytes_sent" $http _refer
Er "" $http _user_agent "$http _x_forwarded_for";
#日志的格式 Access_log/data1/logs/access.log access; }