update ngxproxy

This commit is contained in:
Wonderfall
2016-05-30 13:36:53 +02:00
parent 8781136d93
commit 7c991ab8e1
3 changed files with 11 additions and 6 deletions

View File

@ -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