下载地址:http://nginx.org/en/download.html
上传目录:/usr/local/src/
安装目录:/usr/local/nginx
//安装依赖
yum install gcc-c++ pcre-devel zlib-devel openssl-devel -y //解压
tar -zxvf nginx-1.14.0.tar.gz cd nginx-1.14.0
//配置 ./configure --prefix=/usr/local/nginx --with-pcre --with-http_ssl_module
//编译,安装
make && make install
//添加nginx环境变量
echo "export PATH=$PATH:/usr/local/nginx/sbin" >> /etc/profile
source /etc/profile
## 出错整理
nginx: [emerg] bind() to 0.0.0.0:80 failed ()98: address already in use)
//查看端口使用情况,终止进程
netstat -antp | grep 80
kill PID
nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
//创建配置文件
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
CI框架404错误
vim /usr/local/nginx/conf/nginx.conf
//server模块修改
location / { try_files $uri $uri/ /index.php?$uri&$args;
}