centos7 nginx 安装

添加源

rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

安装

yum install -y nginx

配置

vi /etc/nginx/nginx.conf

user nginx;改为user root;

# 新增或修改代理配置到此目录,参考default.conf
/etc/nginx/conf.d/

启动命令

# 启动
nginx
# 测试当前配置是否正确
nginx -t
# 重载配置
nginx -s reload
# 重启
nginx -s reopen