Skip to content

Commit 172e55c

Browse files
committed
Add conf.d options
1 parent e0f13d5 commit 172e55c

File tree

3 files changed

+53
-3
lines changed

3 files changed

+53
-3
lines changed

.env.sample

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,33 @@ IP=0.0.0.0
2424
NETWORK=webproxy
2525

2626
#
27-
# Service Network
27+
# Service Network (Optional)
28+
#
29+
# In case you decide to add a new network to your services containers you can set this
30+
# network as a SERVICE_NETWORK
31+
#
32+
# [WARNING] This setting was built to use our `start.sh` script or in that special case
33+
# you could use the docker-composer with our multiple network option, as of:
34+
# `docker-compose -f docker-compose-multiple-networks.yml up -d`
2835
#
29-
# This is optional in case you decide to add a new network to your services containers
3036
#SERVICE_NETWORK=webservices
3137

3238
#
3339
# NGINX file path
3440
#
3541
NGINX_FILES_PATH=/path/to/your/nginx/data
3642

43+
#
44+
# NGINX use special conf files
45+
#
46+
# In case you want to add some special configuration to your NGINX Web Proxy you could
47+
# add your files to ./conf.d/ folder as of sample file 'uploadsize.conf'
48+
#
49+
# [WARNING] This setting was built to use our `start.sh`.
50+
#
51+
# [WARNING] Once you set this options to true all your files will be copied to data
52+
# folder (./data/conf.d). If you decide to remove this special configuration
53+
# you must delete your files from data folder ./data/conf.d.
54+
#
55+
#USE_NGINX_CONF_FILES=true
56+

conf.d/uploadsize.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
client_max_body_size 10G;

start.sh

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,36 @@ curl https://raw.githubusercontent.com/jwilder/nginx-proxy/master/nginx.tmpl > n
2727
# 5. Update local images
2828
docker-compose pull
2929

30-
# 6. Start proxy
30+
# 6. Add any special configuration if it's set in .env file
31+
32+
# Check if user set to use Special Conf Files
33+
if [ ! -z ${USE_NGINX_CONF_FILES+X} ] && [ "$USE_NGINX_CONF_FILES" = true ]; then
34+
35+
# Create the conf folder if it does not exists
36+
mkdir -p $NGINX_FILES_PATH/conf.d
37+
38+
# Copy the special configurations to the nginx conf folder
39+
cp -R ./conf.d/* $NGINX_FILES_PATH/conf.d
40+
41+
# Check if there was an error and try with sudo
42+
if [ $? -ne 0 ]; then
43+
sudo cp -R ./conf.d/* $NGINX_FILES_PATH/conf.d
44+
fi
45+
46+
# If there was any errors inform the user
47+
if [ $? -ne 0 ]; then
48+
echo
49+
echo "#######################################################"
50+
echo
51+
echo "There was an error trying to copy the nginx conf files."
52+
echo "The webproxy will still work, your custom configuration"
53+
echo "will not be loaded."
54+
echo
55+
echo "#######################################################"
56+
fi
57+
fi
58+
59+
# 7. Start proxy
3160

3261
# Check if you have multiple network
3362
if [ -z ${SERVICE_NETWORK+X} ]; then

0 commit comments

Comments
 (0)