mirror of
https://github.com/hoellen/dockerfiles.git
synced 2025-04-20 04:19:18 +00:00
ngxproxy: better webroot support
This commit is contained in:
parent
44c83f8bd7
commit
e847e60573
@ -25,6 +25,18 @@ read -p "Webroot (default is /): " WEBROOT
|
||||
|
||||
if [ "$WEBROOT" == "" ]; then
|
||||
WEBROOT="/"
|
||||
else
|
||||
echo "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: " WEBROOT_HEADER
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
while [ "$CONTAINER" == "" ]; do
|
||||
@ -95,6 +107,10 @@ else
|
||||
sed -i '/client_max_body_size/d' /sites-enabled/$NAME.conf
|
||||
fi
|
||||
|
||||
if [ "$CONFIGURE_WEBROOT" == "y" ]; then
|
||||
sed -i "/proxy_pass/a \ \ \ proxy_set_header $WEBROOT_HEADER $WEBROOT;" /sites-enabled/$NAME.conf
|
||||
fi
|
||||
|
||||
sed -i \
|
||||
-e "s|<DOMAIN>|$DOMAIN|g" \
|
||||
-e "s|<CONTAINER>|$CONTAINER|g" \
|
||||
|
Loading…
x
Reference in New Issue
Block a user