Skip to content

Commit

Permalink
add nginx master branch support & disable NGINX_SPDY='n' default
Browse files Browse the repository at this point in the history
- add support for centmin.sh menu option 4 nginx compiles to specify nginx version = master
- SPDY no longer supported in web browsers so set NGINX_SPDY='n' by default
  • Loading branch information
centminmod committed Feb 12, 2018
1 parent 738b97d commit 2da737c
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 37 deletions.
2 changes: 1 addition & 1 deletion centmin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ NGINX_RDNS='n' # https://github.com/flant/nginx-http-rdns
NGINX_NJS='n' # nginScript https://www.nginx.com/blog/launching-nginscript-and-looking-ahead/
NGINX_GEOIP='y' # Nginx GEOIP module install
NGINX_GEOIPMEM='y' # Nginx caches GEOIP databases in memory (default), setting 'n' caches to disk instead
NGINX_SPDY='y' # Nginx SPDY support
NGINX_SPDY='n' # Nginx SPDY support
NGINX_SPDYPATCHED='n' # Cloudflare HTTP/2 + SPDY patch https://github.com/cloudflare/sslconfig/blob/master/patches/nginx__http2_spdy.patch
NGINX_STUBSTATUS='y' # http://nginx.org/en/docs/http/ngx_http_stub_status_module.html required for nginx statistics
NGINX_SUB='y' # http://nginx.org/en/docs/http/ngx_http_sub_module.html
Expand Down
2 changes: 1 addition & 1 deletion example/custom_config.inc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ NGINX_RDNS='n' # https://github.com/flant/nginx-http-rdns
NGINX_NJS='n' # nginScript https://www.nginx.com/blog/launching-nginscript-and-looking-ahead/
NGINX_GEOIP='y' # Nginx GEOIP module install
NGINX_GEOIPMEM='y' # Nginx caches GEOIP databases in memory (default), setting 'n' caches to disk instead
NGINX_SPDY='y' # Nginx SPDY support
NGINX_SPDY='n' # Nginx SPDY support
NGINX_SPDYPATCHED='n' # Cloudflare HTTP/2 + SPDY patch https://github.com/cloudflare/sslconfig/blob/master/patches/nginx__http2_spdy.patch
NGINX_STUBSTATUS='y' # http://nginx.org/en/docs/http/ngx_http_stub_status_module.html required for nginx statistics
NGINX_SUB='y' # http://nginx.org/en/docs/http/ngx_http_sub_module.html
Expand Down
6 changes: 3 additions & 3 deletions inc/nginx_configure.inc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ if [[ "$CENTOS_SEVEN" = '7' || "$CENTOS_SIX" = '6' ]]; then

if [[ "$NGINX_HTTP2" = [yY] ]]; then
# only apply Nginx HTTP/2 if Nginx version is >= 1.9.3 and <1.9.5 OR >= 1.9.5
if [[ "$NGX_VEREVAL" -ge '10903' && "$NGX_VEREVAL" -lt '10905' ]] || [[ "$NGX_VEREVAL" -ge '10905' ]]; then
if [[ "$NGX_VEREVAL" -ge '10903' && "$NGX_VEREVAL" -lt '10905' ]] || [[ "$NGX_VEREVAL" -ge '10905' ]] || [[ "$NGX_VEREVAL" = 'master' ]]; then
if [[ "$NGINX_SPDYPATCHED" = [yY] ]]; then
NGINX_SPDY=y
HTTPTWOOPT=' --with-http_spdy_module --with-http_v2_module'
Expand Down Expand Up @@ -1268,7 +1268,7 @@ else

if [[ "$NGINX_HTTP2" = [yY] ]]; then
# only apply Nginx HTTP/2 if Nginx version is >= 1.9.3 and <1.9.5 OR >= 1.9.5
if [[ "$NGX_VEREVAL" -ge '10903' && "$NGX_VEREVAL" -lt '10905' ]] || [[ "$NGX_VEREVAL" -ge '10905' ]]; then
if [[ "$NGX_VEREVAL" -ge '10903' && "$NGX_VEREVAL" -lt '10905' ]] || [[ "$NGX_VEREVAL" -ge '10905' ]] || [[ "$NGX_VEREVAL" = 'master' ]]; then
if [[ "$NGINX_SPDYPATCHED" = [yY] ]]; then
NGINX_SPDY=y
HTTPTWOOPT=' --with-http_spdy_module --with-http_v2_module'
Expand Down Expand Up @@ -2197,7 +2197,7 @@ else
fi

if [[ "$NGINX_THREADS" = [yY] ]]; then
if [[ "$NGX_VEREVAL" -ge '10800' ]]; then
if [[ "$NGX_VEREVAL" -ge '10800' ]] || [[ "$NGX_VEREVAL" = 'master' ]]; then
THREADS=' --with-threads'
else
THREADS=""
Expand Down
69 changes: 38 additions & 31 deletions inc/nginx_upgrade.inc
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,13 @@ fi
fi

echo "Compiling nginx..."
if [ -s "nginx-${ngver}.tar.gz" ]; then
cecho "nginx ${ngver} Archive found, skipping download..." $boldgreen
if [[ "$ngver" = 'master' ]]; then
rm -rf nginx-${ngver}*
git clone --depth=1 https://github.com/nginx/nginx nginx-master
mv nginx-master/auto/configure nginx-master/configure
fi
if [[ -s "nginx-${ngver}.tar.gz" || "$ngver" = 'master' ]]; then
cecho "nginx ${ngver} download found, skipping download..." $boldgreen
else
download_cmd "http://nginx.org/download/nginx-${ngver}.tar.gz" $WGETRETRY
NGINXDOWNLOAD_CHECK=$?
Expand Down Expand Up @@ -627,37 +632,39 @@ fi
fi
fi

tar xvfz "nginx-${ngver}.tar.gz"
NGINXTAREXTRACT_CHECK=$?
if [[ "$NGINXTAREXTRACT_CHECK" != '0' ]]; then
if [ -f "$(which figlet)" ]; then
figlet -ckf standard "Nginx Tarball Extraction Failed"
fi
echo
echo "!! Nginx Tarball Extraction Failed !!"
echo "try again by running centmin.sh menu option 4"
echo "make sure you type the correct nginx version"
echo "report errors on the forums at community.centminmod.com/forums/8/"
echo
free -m
echo
df -hT
echo
echo "CPU: $(awk -F ': ' '/^model name/ {print $2}' /proc/cpuinfo | head -n1) ($(grep -c "processor" /proc/cpuinfo))"
echo
echo
echo "version increment history"
tail -5 /etc/centminmod-versionlog
if [ -d "${SCRIPT_DIR}/.git" ]; then
if [[ "$ngver" != 'master' ]]; then
tar xvfz "nginx-${ngver}.tar.gz"
NGINXTAREXTRACT_CHECK=$?
if [[ "$NGINXTAREXTRACT_CHECK" != '0' ]]; then
if [ -f "$(which figlet)" ]; then
figlet -ckf standard "Nginx Tarball Extraction Failed"
fi
echo
echo "last Centmin Mod local git commit entry"
pushd "${SCRIPT_DIR}"
git log --numstat --pretty="%n%h %an %aD %n%s" --shortstat -1
popd
echo "!! Nginx Tarball Extraction Failed !!"
echo "try again by running centmin.sh menu option 4"
echo "make sure you type the correct nginx version"
echo "report errors on the forums at community.centminmod.com/forums/8/"
echo
free -m
echo
df -hT
echo
echo "CPU: $(awk -F ': ' '/^model name/ {print $2}' /proc/cpuinfo | head -n1) ($(grep -c "processor" /proc/cpuinfo))"
echo
echo
echo "version increment history"
tail -5 /etc/centminmod-versionlog
if [ -d "${SCRIPT_DIR}/.git" ]; then
echo
echo "last Centmin Mod local git commit entry"
pushd "${SCRIPT_DIR}"
git log --numstat --pretty="%n%h %an %aD %n%s" --shortstat -1
popd
fi

rm -rf "$DIR_TMP/nginx-*.tar.gz"
exit
fi

rm -rf "$DIR_TMP/nginx-*.tar.gz"
exit
fi
cd "nginx-${ngver}"
if [[ "$INITIALINSTALL" != [yY] ]]; then
Expand Down
2 changes: 1 addition & 1 deletion tools/nginxupdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ NGINX_RDNS='n' # https://github.com/flant/nginx-http-rdns
NGINX_NJS='n' # nginScript https://www.nginx.com/blog/launching-nginscript-and-looking-ahead/
NGINX_GEOIP='y' # Nginx GEOIP module install
NGINX_GEOIPMEM='y' # Nginx caches GEOIP databases in memory (default), setting 'n' caches to disk instead
NGINX_SPDY='y' # Nginx SPDY support
NGINX_SPDY='n' # Nginx SPDY support
NGINX_STUBSTATUS='y' # http://nginx.org/en/docs/http/ngx_http_stub_status_module.html required for nginx statistics
NGINX_SUB='y' # http://nginx.org/en/docs/http/ngx_http_sub_module.html
NGINX_ADDITION='y' # http://nginx.org/en/docs/http/ngx_http_addition_module.html
Expand Down

0 comments on commit 2da737c

Please sign in to comment.