nginx configuration and common scenarios

Nginx major command

./nginx start nginx
./nginx -s STOP to terminate nginx (of course, you can also find nginx process number, then use the kill -9 to kill nginx process)
./nginx -s reload (reload nginx.conf profile)

Nginx core configuration file conf / nginx.conf contains three elements: global block, block events, http block
global block
from the profile start to block content between events, the overall impact of the running configuration here nginx server, such as worker number of processes, such as the location of the error log
events block
events block main impact nginx server and the user's network connection, such as worker_connections 1024, the maximum number of connections supported for the identification of each workderprocess 1024
http blocks
http configuration block is most frequently part of a virtual host configuration, monitoring port configuration, request forwarding, reverse proxy, load balancing, etc.

#全局块
#从配置文件开始到events块之间的内容,此处的配置影响nginx服务器整体的运行,比如worker进 程的数量、错误日志的位置等
#============================start 全局块,从开始到events块之间的内容================
#运行用户
#user  nobody;
#worker 进程数量,通常设置为和cpu数量相等
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;
#======================end  全局块==============


#events块
#events块主要影响nginx服务器与用户的网络连接,比如worker_connections 1024,标识每个workderprocess支持的最大连接数为1024
#==

Guess you like

Origin blog.csdn.net/zc888168/article/details/105255723