Skip to content

Commit 18e3440

Browse files
authored
Adds nginx-proxy config file to support large file uploads (#26)
* Allow uploads bigger than 1M - also lets projects customise their nginx config. * Volumes must be full path, not relative. Nicer comment. * Break up connect the web container to the nginx-proxy. Start nginx-proxy first to allow running setup command from the scaffold. * Doh, wrong brackets. Exec, not variable.
1 parent 2d10e23 commit 18e3440

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

dsh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ setup() {
161161
fi
162162
setup_ssh_agent_proxy
163163
fi
164-
setup_docker_network
165164
setup_nginx_proxy
165+
setup_docker_network
166+
setup_nginx_connect
166167
}
167168

168169
setup_docker_machine() {
@@ -231,16 +232,20 @@ setup_nginx_proxy() {
231232
if docker ps -a | grep "nginx-proxy" > /dev/null; then
232233
docker start nginx-proxy > /dev/null
233234
else
235+
# Configuration is only applied when the container is created.
234236
docker run -d -p 80:80 \
235237
-v /var/run/docker.sock:/tmp/docker.sock:ro \
238+
-v /etc/nginx/conf.d/dsh_proxy.conf:$(pwd)/dsh_proxy.conf \
236239
--restart always --name nginx-proxy \
237240
jwilder/nginx-proxy
238241
fi
239242

240243
if ! docker ps | grep "nginx-proxy" > /dev/null; then
241244
error "jwilder/nginx-proxy could not be started."
242245
fi
246+
}
243247

248+
setup_nginx_connect() {
244249
set +e
245250
# Test to make sure its not already on the network.
246251
if ! docker network inspect ${PROJECT}_default | grep "nginx-proxy" > /dev/null; then

dsh_proxy.conf

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

src/Handler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public function updateShepherdScaffoldFiles()
8181
$projectPath,
8282
[
8383
'docker-compose.yml',
84+
'dsh_proxy.conf',
8485
'RoboFile.php',
8586
]
8687
);

0 commit comments

Comments
 (0)