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
|
||||
done
|
||||
|
||||
read -p "Webroot (default is /) ": WEBROOT
|
||||
|
||||
if [ "$WEBROOT" == "" ]; then
|
||||
WEBROOT="/"
|
||||
fi
|
||||
|
||||
while [ "$CONTAINER" == "" ]; do
|
||||
read -p "Container: " CONTAINER
|
||||
ping -c 1 $CONTAINER >/dev/null 2>&1
|
||||
@ -93,6 +99,7 @@ sed -i \
|
||||
-e "s|<DOMAIN>|$DOMAIN|g" \
|
||||
-e "s|<CONTAINER>|$CONTAINER|g" \
|
||||
-e "s|<PORT>|$PORT|g" \
|
||||
-e "s|<WEBROOT>|$WEBROOT|g" \
|
||||
/sites-enabled/$NAME.conf
|
||||
|
||||
echo ""
|
||||
|
@ -4,7 +4,7 @@ server {
|
||||
|
||||
client_max_body_size <MAX_BODY_SIZE>M;
|
||||
|
||||
location / {
|
||||
location <WEBROOT> {
|
||||
proxy_pass http://<CONTAINER>:<PORT>;
|
||||
include /etc/nginx/conf/proxy_params;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ server {
|
||||
|
||||
client_max_body_size <MAX_BODY_SIZE>M;
|
||||
|
||||
location / {
|
||||
location <WEBROOT> {
|
||||
proxy_pass http://<CONTAINER>:<PORT>;
|
||||
include /etc/nginx/conf/proxy_params;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user