Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/nginx-custom.options
49 changes: 33 additions & 16 deletions nginx-autoinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ case $OPTION in
esac
fi
if [[ $HEADLESS != "y" ]]; then
echo ""
# Check if custom nginx configuration exists and load it
if [ -f nginx-custom.options ]; then
#read -p "Found nginx-custom.options, we'll use those instead of default."
echo "Found nginx-custom.options, we'll use those instead of default."
source nginx-custom.options
fi
echo ""
read -n1 -r -p "Nginx is ready to be installed, press any key to continue..."
echo ""
Expand Down Expand Up @@ -326,22 +333,30 @@ case $OPTION in
wget https://raw.githubusercontent.com/Angristan/nginx-autoinstall/master/conf/nginx.conf
fi
cd /usr/local/src/nginx/nginx-${NGINX_VER} || exit 1

NGINX_OPTIONS="
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--user=nginx \
--group=nginx \
--with-cc-opt=-Wno-deprecated-declarations \
--with-cc-opt=-Wno-ignored-qualifiers"
if [ -z ${NGINX_OPTIONS+x} ];
then
echo "No custom NGINX_OPTIONS found, using default"
NGINX_OPTIONS="
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--user=nginx \
--group=nginx \
--with-cc-opt=-Wno-deprecated-declarations \
--with-cc-opt=-Wno-ignored-qualifiers"
fi

if [ -z ${NGINX_MODULES+x} ];
then
echo "No custom NGINX_MODULES found, using default"
read -p "No NGINX_OPTIONS found, using default, press to continue"

NGINX_MODULES="--with-threads \
--with-file-aio \
Expand All @@ -354,6 +369,8 @@ case $OPTION in
--with-http_realip_module \
--with-http_sub_module"

fi

# Optional options
if [[ $LUA == 'y' ]]; then
NGINX_OPTIONS=$(
Expand Down
40 changes: 40 additions & 0 deletions nginx-custom.options.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Custom Nginx compile options
# if renamed to nginx-custom.options
# will overwride values of NGINX_OPTIONS and/or NGINX_MODULES
# if defined here


# Optional
# NGINX_OPTIONS="
# --prefix=/etc/nginx \
# --sbin-path=/usr/sbin/nginx \
# --conf-path=/etc/nginx/nginx.conf \
# --error-log-path=/var/log/nginx/error.log \
# --http-log-path=/var/log/nginx/access.log \
# --pid-path=/var/run/nginx.pid \
# --lock-path=/var/run/nginx.lock \
# --http-client-body-temp-path=/var/cache/nginx/client_temp \
# --http-proxy-temp-path=/var/cache/nginx/proxy_temp \
# --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
# --user=nginx \
# --group=nginx \
# --with-cc-opt=-Wno-deprecated-declarations"

#Optional
# NGINX_MODULES="--without-http_ssi_module \
# --without-http_scgi_module \
# --without-http_uwsgi_module \
# --without-http_geo_module \
# --without-http_split_clients_module \
# --without-http_memcached_module \
# --without-http_empty_gif_module \
# --without-http_browser_module \
# --with-threads \
# --with-file-aio \
# --with-http_ssl_module \
# --with-http_v2_module \
# --with-http_mp4_module \
# --with-http_auth_request_module \
# --with-http_slice_module \
# --with-http_stub_status_module \
# --with-http_realip_module"