Skip to content

Instantly share code, notes, and snippets.

@BigSully
Created October 26, 2020 21:27
Show Gist options
  • Save BigSully/f4e2b0f498659ad628485af07ae70a17 to your computer and use it in GitHub Desktop.
Save BigSully/f4e2b0f498659ad628485af07ae70a17 to your computer and use it in GitHub Desktop.
compile nginx on macos
OPTS=''
## nginx
curl -OL http://nginx.org/download/nginx-1.19.3.tar.gz
tar -xf nginx-*.tar.gz
## pcre
curl -OL https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
tar -xf pcre-*.tar.gz
OPTS="$OPTS --with-pcre=../pcre-8.44/"
## openssl
curl -OL https://www.openssl.org/source/openssl-1.1.0g.tar.gz
tar -xf openssl-*.tar.gz
OPTS="$OPTS --with-openssl=../openssl-1.1.0g/"
## rtmp
curl -L -o nginx-rtmp-module-1.2.1.tar.gz https://github.com/arut/nginx-rtmp-module/archive/v1.2.1.tar.gz
tar -xf nginx-rtmp-module-*.tar.gz
OPTS="$OPTS --add-module=../nginx-rtmp-module-1.2.1/"
## start compiling
cd nginx*
OPTS="$OPTS
--prefix=/usr/local/nginx/
--sbin-path=/usr/local/sbin/nginx
--with-compat
--with-debug
--with-http_addition_module
--with-http_auth_request_module
--with-http_dav_module
--with-http_degradation_module
--with-http_flv_module
--with-http_gunzip_module
--with-http_gzip_static_module
--with-http_mp4_module
--with-http_random_index_module
--with-http_realip_module
--with-http_secure_link_module
--with-http_slice_module
--with-http_ssl_module
--with-http_stub_status_module
--with-http_sub_module
--with-http_v2_module
--with-ipv6
--with-mail
--with-mail_ssl_module
--with-pcre
--with-pcre-jit
--with-stream
--with-stream_realip_module
--with-stream_ssl_module
--with-stream_ssl_preread_module
--with-http_xslt_module
--with-http_perl_module
--with-mail=dynamic
"
## compiling
./configure $OPTS
sudo make
sudo make install
## check
echo 'End of compilation: '
nginx -V
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment