修改nginx配置文件---务必做

1、修改配置文件

重要:修改配置文件使用虚拟机,否则怎么配置都不生效,添加如下用户

[root@host-10-1-1-161 html]# ll /etc/nginx/nginx.conf
-rw-r--r-- 1 root root 345 Aug 26 10:41 /etc/nginx/nginx.conf
[root@host-10-1-1-161 html]# vi /etc/nginx/nginx.conf
user root root;                      #说明:这里的user根据 自己的nginx.conf文件所在的目录的属主属性而定 
worker_processes 1;




2、整个配置文件,其他都删除,没用


[root@host-10-1-1-161 web]# cat /etc/nginx/nginx.conf
user root root; 
worker_processes 1;
events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;

server {
listen 80;
server_name www.nginx01.com;
location / {
root html;
index index.html index.htm;
}
}

}

猜你喜欢

转载自www.cnblogs.com/effortsing/p/10027482.html