MacOS编译安装nginx

#!/bin/bash

curl -O http://nginx.org/download/nginx-1.16.1.tar.gz
tar zxf nginx-1.16.1.tar.gz

curl -O http://zlib.net/zlib-1.2.11.tar.gz
tar zxf zlib-1.2.11.tar.gz

curl -O https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
tar zxf pcre-8.44.tar.gz

cd nginx-1.16.1
sed -i '' 's/CFLAGS="$CFLAGS -g"/# CFLAGS="$CFLAGS -g"/g' auto/cc/gcc
./configure --prefix=/usr/local/nginx \
--with-zlib=../zlib-1.2.11 --with-pcre=../pcre-8.44
--with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_sub_module \
--with-stream --with-stream_ssl_module --with-http_v2_module \
--with-http_mp4_module --with-http_secure_link_module --with-http_auth_request_module
make
sudo make install