update ngxpasswd and ngxproxy

This commit is contained in:
Wonderfall 2016-05-30 18:10:49 +02:00
parent a1cc861066
commit fd9239b4eb
5 changed files with 18 additions and 17 deletions

View File

@ -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>/$NAME/g" /sites-enabled/$NAME.conf
sed -i -e 's/#auth/auth/g' -e "s/<NAME>/$NAME/g" /sites-enabled/$NAME.conf
echo "Automatically added, please verify. Otherwise follow these instructions."
echo
fi

View File

@ -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
@ -102,9 +102,7 @@ while [ "$MAX_BODY_SIZE" == "" ]; do
done
if [ "$MAX_BODY_SIZE" != "n" ]; then
sed -i "s|<MAX_BODY_SIZE>|$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 <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>|$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

View File

@ -2,7 +2,10 @@ server {
listen 8000;
server_name <DOMAIN>;
client_max_body_size <MAX_BODY_SIZE>M;
#client_max_body_size <MAX_BODY_SIZE>M;
#auth_basic "Who's this?";
#auth_basic_user_file /passwds/<NAME>.htpasswd;
location <WEBROOT> {
proxy_pass http://<CONTAINER>:<PORT>;

View File

@ -14,7 +14,10 @@ server {
include /conf.d/ssl_params.conf;
include /etc/nginx/conf/headers_params;
client_max_body_size <MAX_BODY_SIZE>M;
#client_max_body_size <MAX_BODY_SIZE>M;
#auth_basic "Who's this?";
#auth_basic_user_file /passwds/<NAME>.htpasswd;
location <WEBROOT> {
proxy_pass http://<CONTAINER>:<PORT>;

View File

@ -1,2 +0,0 @@
auth_basic "Who's this?";
auth_basic_user_file /passwds/<NAME>.htpasswd;