ngxproxy: add webroot support

This commit is contained in:
Wonderfall 2016-05-30 14:38:08 +02:00
parent fe8c943b7e
commit c62c45db31
3 changed files with 12 additions and 5 deletions

View File

@ -21,6 +21,12 @@ while [ "$DOMAIN" == "" ]; do
fi fi
done done
read -p "Webroot (default is /) ": WEBROOT
if [ "$WEBROOT" == "" ]; then
WEBROOT="/"
fi
while [ "$CONTAINER" == "" ]; do while [ "$CONTAINER" == "" ]; do
read -p "Container: " CONTAINER read -p "Container: " CONTAINER
ping -c 1 $CONTAINER >/dev/null 2>&1 ping -c 1 $CONTAINER >/dev/null 2>&1
@ -93,6 +99,7 @@ sed -i \
-e "s|<DOMAIN>|$DOMAIN|g" \ -e "s|<DOMAIN>|$DOMAIN|g" \
-e "s|<CONTAINER>|$CONTAINER|g" \ -e "s|<CONTAINER>|$CONTAINER|g" \
-e "s|<PORT>|$PORT|g" \ -e "s|<PORT>|$PORT|g" \
-e "s|<WEBROOT>|$WEBROOT|g" \
/sites-enabled/$NAME.conf /sites-enabled/$NAME.conf
echo "" echo ""

View File

@ -4,7 +4,7 @@ server {
client_max_body_size <MAX_BODY_SIZE>M; client_max_body_size <MAX_BODY_SIZE>M;
location / { location <WEBROOT> {
proxy_pass http://<CONTAINER>:<PORT>; proxy_pass http://<CONTAINER>:<PORT>;
include /etc/nginx/conf/proxy_params; include /etc/nginx/conf/proxy_params;
} }

View File

@ -16,7 +16,7 @@ server {
client_max_body_size <MAX_BODY_SIZE>M; client_max_body_size <MAX_BODY_SIZE>M;
location / { location <WEBROOT> {
proxy_pass http://<CONTAINER>:<PORT>; proxy_pass http://<CONTAINER>:<PORT>;
include /etc/nginx/conf/proxy_params; include /etc/nginx/conf/proxy_params;
} }