Skip to content

Commit e236f00

Browse files
committed
Fix using custom nginx config
1 parent 63057ce commit e236f00

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/plugins/proxy/assets/templates/start.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,16 @@ echo "Pulled jwilder/nginx-proxy and jrcs/letsencrypt-nginx-proxy-companion"
3131

3232
# This updates nginx for all vhosts
3333
NGINX_CONFIG="client_max_body_size $CLIENT_UPLOAD_LIMIT;";
34-
echo $NGINX_CONFIG >> /opt/$APPNAME/config/nginx-default.conf
34+
NGINX_CONFIG_PATH="/opt/$APPNAME/config/nginx-default.conf"
35+
36+
# Only add if it doesn't already exist
37+
# The value should only change when `mup proxy reconfig-shared` is run
38+
# That also resets the config, allowing this line to be added again with the new value
39+
# If the user's custom config already has this option, or a comment
40+
# containing this option, then the config will not be modified
41+
if ! grep -q "client_max_body_size" "$NGINX_CONFIG_PATH"; then
42+
echo $NGINX_CONFIG >> /opt/$APPNAME/config/nginx-default.conf
43+
fi
3544

3645
sudo docker run \
3746
-d \

src/plugins/proxy/command-handlers.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,9 @@ export function reconfigShared(api) {
186186
});
187187

188188
const sharedNginxConfig = shared.nginxConfig || api.resolvePath(__dirname, 'assets/proxy.conf');
189-
190189
list.copy('Sending nginx config', {
191190
src: sharedNginxConfig,
192-
dest: `/opt/${PROXY_CONTAINER_NAME}/nginx-default.conf`
191+
dest: `/opt/${PROXY_CONTAINER_NAME}/config/nginx-default.conf`
193192
});
194193

195194
const sessions = api.getSessions(['app']);

0 commit comments

Comments
 (0)