diff --git a/boring-nginx/ngxpasswd b/boring-nginx/ngxpasswd index c70f0f8..9e80a84 100644 --- a/boring-nginx/ngxpasswd +++ b/boring-nginx/ngxpasswd @@ -1,9 +1,9 @@ #!/bin/sh -echo "" +echo echo "Welcome to ngxpasswd utility." echo "We're about to create a password file." -echo "" +echo cd /passwds || exit 1 @@ -46,8 +46,7 @@ if [ -f "/sites-enabled/$NAME.conf" ]; then if [ "$ADD" == "y" ]; then cd /etc/nginx/conf - sed -i "/location/r vhost_passwd.conf" /sites-enabled/$NAME.conf - sed -i "s//$NAME/g" /sites-enabled/$NAME.conf + sed -i -e 's/#auth/auth/g' -e "s//$NAME/g" /sites-enabled/$NAME.conf echo "Automatically added, please verify. Otherwise follow these instructions." echo fi diff --git a/boring-nginx/ngxproxy b/boring-nginx/ngxproxy index 743757e..f535dcf 100644 --- a/boring-nginx/ngxproxy +++ b/boring-nginx/ngxproxy @@ -1,9 +1,9 @@ #!/bin/sh -echo "" +echo echo "Welcome to ngxproxy utility." echo "We're about to create a new vhost." -echo "" +echo while [ "$NAME" == "" ]; do read -p "Name: " NAME @@ -27,11 +27,11 @@ if [ "$WEBROOT" == "" ]; then WEBROOT="/" else echo "WARNING: Depending on the app, you might have to add a proxy header to get your custom webroot working." - + while [[ "$CONFIGURE_WEBROOT" != "y" && "$CONFIGURE_WEBROOT" != "n" ]]; do read -p "Is it required to configure it? [y/n]: " CONFIGURE_WEBROOT done - + if [ "$CONFIGURE_WEBROOT" == "y" ]; then while [ "$WEBROOT_HEADER" == "" ]; do read -p "Type the required proxy_set_header (something like X-Script-Name): " WEBROOT_HEADER @@ -102,9 +102,7 @@ while [ "$MAX_BODY_SIZE" == "" ]; do done if [ "$MAX_BODY_SIZE" != "n" ]; then - sed -i "s||$MAX_BODY_SIZE|g" /sites-enabled/$NAME.conf -else - sed -i '/client_max_body_size/d' /sites-enabled/$NAME.conf + sed -i "s|#client_max_body_size |client_max_body_size $MAX_BODY_SIZE|g" /sites-enabled/$NAME.conf fi if [ "$CONFIGURE_WEBROOT" == "y" ]; then @@ -118,7 +116,7 @@ sed -i \ -e "s||$WEBROOT|g" \ /sites-enabled/$NAME.conf -echo "" +echo echo "It's done : $NAME.conf has been generated." while [[ "$RELOAD" != "y" && "$RELOAD" != "n" ]]; do @@ -132,5 +130,5 @@ else echo "Restart manually nginx to enable this new vhost." fi -echo "" +echo exit 0 diff --git a/boring-nginx/vhost_http.conf b/boring-nginx/vhost_http.conf index 72a5be0..7e3a99b 100644 --- a/boring-nginx/vhost_http.conf +++ b/boring-nginx/vhost_http.conf @@ -2,7 +2,10 @@ server { listen 8000; server_name ; - client_max_body_size M; + #client_max_body_size M; + + #auth_basic "Who's this?"; + #auth_basic_user_file /passwds/.htpasswd; location { proxy_pass http://:; diff --git a/boring-nginx/vhost_https.conf b/boring-nginx/vhost_https.conf index 382148b..947c106 100644 --- a/boring-nginx/vhost_https.conf +++ b/boring-nginx/vhost_https.conf @@ -14,7 +14,10 @@ server { include /conf.d/ssl_params.conf; include /etc/nginx/conf/headers_params; - client_max_body_size M; + #client_max_body_size M; + + #auth_basic "Who's this?"; + #auth_basic_user_file /passwds/.htpasswd; location { proxy_pass http://:; diff --git a/boring-nginx/vhost_passwd.conf b/boring-nginx/vhost_passwd.conf deleted file mode 100644 index 39ef4ca..0000000 --- a/boring-nginx/vhost_passwd.conf +++ /dev/null @@ -1,2 +0,0 @@ - auth_basic "Who's this?"; - auth_basic_user_file /passwds/.htpasswd;