From 7c991ab8e1b0b92494a1e273572bc109298440f2 Mon Sep 17 00:00:00 2001 From: Wonderfall Date: Mon, 30 May 2016 13:36:53 +0200 Subject: [PATCH] update ngxproxy --- boring-nginx/ngxproxy | 11 ++++++++--- boring-nginx/vhost_http.conf | 2 +- boring-nginx/vhost_https.conf | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/boring-nginx/ngxproxy b/boring-nginx/ngxproxy index 3e4a29b..679f0bd 100644 --- a/boring-nginx/ngxproxy +++ b/boring-nginx/ngxproxy @@ -34,6 +34,12 @@ read -p "Port (default is 80): " PORT if [ "$PORT" == "" ]; then PORT="80" +elif ! [ "$PORT" -eq "$PORT" ] 2>/dev/null; then + echo "ERROR: an integer value was expected." + exit 1 +elif [ "$PORT" -gt "65535" ]; then + echo "ERROR: $PORT exceeds the maximum TCP port which is 65535" + exit 1 fi while [[ "$HTTPS" != "y" && "$HTTPS" != "n" ]]; do @@ -60,9 +66,8 @@ if [ "$HTTPS" == "y" ]; then read -p "Secure headers [y/n]: " HEADERS done - if [ "$HEADERS" == "y" ]; then - sed -i 's|#include /etc/nginx/conf/headers_params|include /etc/nginx/conf/headers_params|g' \ - /sites-enabled/$NAME.conf + if [ "$HEADERS" == "n" ]; then + sed -i '|include /etc/nginx/conf/headers_params|d' /sites-enabled/$NAME.conf fi else cp /etc/nginx/conf/vhost_http.conf /sites-enabled/${NAME}.conf diff --git a/boring-nginx/vhost_http.conf b/boring-nginx/vhost_http.conf index 22f7d29..63a7bce 100644 --- a/boring-nginx/vhost_http.conf +++ b/boring-nginx/vhost_http.conf @@ -2,7 +2,7 @@ server { listen 8000; server_name ; - #client_max_body_size M; + client_max_body_size M; location / { proxy_pass http://:; diff --git a/boring-nginx/vhost_https.conf b/boring-nginx/vhost_https.conf index 99d19bc..5256e73 100644 --- a/boring-nginx/vhost_https.conf +++ b/boring-nginx/vhost_https.conf @@ -12,9 +12,9 @@ server { ssl_certificate_key ; include /conf.d/ssl_params.conf; - #include /etc/nginx/conf/headers_params; + include /etc/nginx/conf/headers_params; - #client_max_body_size M; + client_max_body_size M; location / { proxy_pass http://:;