A, ubuntu system installation services nginx
# apt-get install nginx
Two, nginx.config Detailed profiles
The configuration file structure:
Global block (global variable)
events{
}
http{
http global variables
# Upstream module is not an essential
# upstream{
# }
server{
Global server
{location block
}
}
}
Global block comprising:
user nginx nginx; // Nginx users and groups: User group. window without specifying
worker_processes 8; // work process: the number. The adjustment hardware, typically equal to or twice the number of CPU on the CPU.
// error log: storage path.
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
pid logs / nginx.pid; // pid (Process Identifier): storage path.
worker_rlimit_nofile 204800; // process can open the specified maximum descriptor: number.