CentOS上编译安装Nginx

背景

为了解决CentOS7.2自带的Nginx上没有auth-request支持的问题,须要本身手工编译安装Nginx .html

安装依赖

更新yumlinux

yum update -y
yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel

编译与安装

下载(可访问官网下载最新版)nginx

wget http://nginx.org/download/nginx-1.10.1.tar.gz

解压c++

tar -xvf nginx-1.10.1.tar.gz

编译git

cd cd nginx-1.10.1
./configure --with-http_auth_request_module

安装github

make && make install

运行ide

/usr/local/nginx/sbin/nginx

其余

判断当前版本是否支持某项功能的命令https://github.com/shopware/devdocs/blob/master/source/blog/_posts/2015-03-02-sso-with-nginx-auth_request.md#installationpost

nginx -V 2>&1 | grep -qF -- --with-http_auth_request_module && echo ":)" || echo ":("

备注

最后我发现,能够经过安装官方的版本解决没有auth_request支持的问题。看链接吧,都是泪!ui

相关文章
相关标签/搜索