Configuration file ( Description)
User nginx; Nginx the running Account ( This account will be created automatically when RPM is installed ), can also be written User Nginx Nginx represents users and Groups
Worker_processes ; number of worker processes (worker), generally equals CPU number of cores or twice times
worker_rlimit_nofile 100000; File Descriptor Quantity
Error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log Notice
#error_log /var/log/nginx/error.log Info
Pid /var/run/nginx.pid;
Events {
Worker_connections 1024x768; each worker number of connections allowed by the process
Use epoll; Network I/O Event Model , Linux Recommended for Epoll,freebsd Recommended for Kqueue
}
HTTP {
Include /etc/nginx/mime.types; include used to refer to other configuration files , that is, you can write different configurations to different files according to your requirements.
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";
Defining log Formats , format name is set to Main
Access_log /var/log/nginx/access.log Main
Access path to the log file , using the above defined Main format Record
Sendfile On
Tcp_nopush On
Tcp_nodelay On
Server_tokens Off
gzip on; Enable compression
Gzip_static on; enabled httpgzipstatic Module ( not in core and standard module groups , but rpm installation with this module )
Gzip_comp_level 5; compression Level , 1 the smallest and fastest , 9 the largest and slowest
Gzip_min_length 1024x768; minimum length of compression , less than this length of no compression ( This length is The content-length in the header )
Keepalive_timeout 65;
Limit_zone MyZone $binary _remote_addr 10m;
# Load config files from the/etc/nginx/conf.d directory
include/etc/nginx/conf.d/*.conf;
server {
Limit_conn MyZone 10;
Listen 80; Port
server_name _; Domain name
#charset koi8-r;
#access_log logs/host.access.log main;
location/{
root /usr/share/nginx/html; home directory
index index.html index.htm;
}
..................
Above describes the Nginx configuration file simple description, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.