wget http://nginx.org/download/nginx-1.21.6.tar.gz
yum install gcc-c++
yum install -y pcre pcre-devel latest versions
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
./configure \
--prefix=/usr/local/nginx \
--with-http_stub_status_module \
--with-http_ssl_module \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/temp/nginx/client \
--http-proxy-temp-path=/var/temp/nginx/proxy \
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
--http-scgi-temp-path=/var/temp/nginx/scgi
注意:上边将临时文件目录指定为/var/temp/nginx,需要在/var下创建temp及nginx目录
make && make install
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
rewrite ^/(.*) http://yuntue.com/$1 permanent;