nginx配置基本命令

grep -Ev ‘#|^$’ nginx.conf.default > nginx.conf
nginx重启 systemctl restart nginx
检查nginx.conf是否正确 nginx -t -c /etc/nginx/nginx.conf

nginx.conf 的基本配置项

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
worker_processes 1;
events{
worker_connections 1024;
}
http{
include mime.types;
default_type application/octet-stream;
server{
listen 80;
server_name guqimeng.com;
location / {
root /var/www/html/public;
index index.html;
}
}
}