mirror of
https://github.com/hoellen/dockerfiles.git
synced 2025-04-20 04:19:18 +00:00
ngxproxy: add webroot support
This commit is contained in:
parent
fe8c943b7e
commit
c62c45db31
@ -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 ""
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user