  #!/bin/bash

  CURRDIR=`dirname "$0"`
  BASEDIR=`cd "$CURRDIR"; pwd`

  VERSION=1.28.0
  cd $BASEDIR/nginx-$VERSION

  ./configure --prefix=/usr/local/nginx/nginx-1.28.0 \
  --conf-path=/usr/local/nginx/nginx-1.28.0/conf/nginx.conf \
  --sbin-path=/usr/local/nginx/nginx-1.28.0/sbin/nginx \
  --pid-path=/usr/local/nginx/nginx-1.28.0/logs/nginx.pid \
  --error-log-path=/usr/local/nginx/nginx-1.28.0/logs/error.log \
  --http-log-path=/usr/local/nginx/nginx-1.28.0/logs/access.log \
  --http-client-body-temp-path=/usr/local/nginx/nginx-1.28.0/client_body_temp \
  --http-proxy-temp-path=/usr/local/nginx/nginx-1.28.0/proxy_temp \
  --http-fastcgi-temp-path=/usr/local/nginx/nginx-1.28.0/fastcgi_temp \
  --http-uwsgi-temp-path=/usr/local/nginx/nginx-1.28.0/uwsgi_temp \
  --http-scgi-temp-path=/usr/local/nginx/nginx-1.28.0/scgi_temp \
  --user=root \
  --group=root \
  --with-http_ssl_module \
  --with-http_realip_module \
  --with-http_flv_module \
  --with-http_mp4_module \
  --with-http_gunzip_module \
  --with-http_gzip_static_module \
  --with-http_secure_link_module \
  --with-http_v2_module \
  --with-http_stub_status_module \
  --with-http_sub_module \
  --with-http_perl_module \
  --with-mail \
  --with-mail_ssl_module \
  --with-stream \
  --with-stream_ssl_module \
  --with-file-aio \
  --with-ipv6 \
  --with-pcre=../pcre-8.45 \
  --with-perl_modules_path=/usr/local/nginx/nginx-1.28.0/modules \
  --with-zlib=../zlib-1.2.11 \
  --with-openssl=../openssl-1.1.0i
  #--with-ld-opt="-Wl,-rpath,/usr/local/luajit/lib" \
  #--add-module=../lua-nginx-module-0.10.20 \
  #--add-module=../ngx_devel_kit_v0.3.1 \
  #--add-module=../nginx-rtmp-module-1.2.2

  make && make install
  chmod +s /usr/local/nginx/nginx-1.28.0/sbin/nginx
