[root@172 nginx]# cat nginx.conf
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user root;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
nginx 权限(默认为nginx会导致403 错误)
user nobody;
user root
Nginx.conf开头不能默认为nginx,修改为nobody 或者root切记!!!
最简单配置
root方式默认80端口指定域名才可以
内网访问修改host服务器ip指向nginx.conf里面的server域名