Object | Commands | Environment | Note |
---|---|---|---|
configtest | nginx -t | Ubuntu RHEL7/CentOS7 | |
Check Status | systemctl status nginx | RHEL7/CentOS7 Ubuntu20.04 | |
Stop | systemctl stop nginx | RHEL7/CentOS7 Ubuntu20.04 | |
Start | systemctl start nginx | RHEL7/CentOS7 Ubuntu20.04 |
ln -s /etc/nginx/sites-available/aaa.example.com /etc/nginx/sites-enabled/aaa.example.com ln -s /etc/nginx/sites-available/aaa.example.com /etc/nginx/sites-enabled/bbb.example.com
You can set it to the same number cpu cores.
#grep processor /proc/cpuinfo | wc -l worker_processes 2;
It specifies the maximum number of connections that one of the worker process can be processed at the same time
#ulimit -n events { worker_connections 1024; }
http { server_tokens off;
## # Virtual Host Configs ## include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*;
ln -s /etc/nginx/sites-available/aaa.example.com /etc/nginx/sites-enabled/aaa.example.com ln -s /etc/nginx/sites-available/aaa.example.com /etc/nginx/sites-enabled/bbb.example.com
root /usr/share/nginx/html;
server { server_name example.com; } server { server_name example.com www.example.com; } server { server_name *.example.com; }
server { listen *:80 default_server; server_name example.com; }
server { listen 443 ssl; (abbr) ssl on; ssl_certificate /etc/nginx/ssl/xxx.crt; ssl_certificate_key /etc/nginx/ssl/xxx.key; ssl_session_timeout 5m; ssl_ciphers 'AES128+EECDH:AES128+EDH:!aNULL'; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; (abbr) }