From 0bd6b041c82834219ecc4af852576f52eb1267cb Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 27 Sep 2017 21:50:14 -0500 Subject: [PATCH 1/2] Update nginx.md Added an explanation of how to add additional nginx configuration to the `nginx.conf` file imported in a Procfile. Here's a related issue: https://github.com/dokku/dokku/issues/2917#issuecomment-332704867 --- docs/configuration/nginx.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/configuration/nginx.md b/docs/configuration/nginx.md index 089e8e693..8835dfbbf 100644 --- a/docs/configuration/nginx.md +++ b/docs/configuration/nginx.md @@ -194,13 +194,25 @@ That means you can put additional configuration in separate files, for example t ```shell mkdir /home/dokku/myapp/nginx.conf.d/ -echo 'client_max_body_size 50M;' > /home/dokku/myapp/nginx.conf.d/upload.conf +echo 'client_max_body_size 50m;' > /home/dokku/myapp/nginx.conf.d/upload.conf chown dokku:dokku /home/dokku/myapp/nginx.conf.d/upload.conf service nginx reload ``` The example above uses additional configuration files directly on the Dokku host. Unlike the `nginx.conf.sigil` file, these additional files will not be copied over from your application repo, and thus need to be placed in the `/home/dokku/myapp/nginx.conf.d/` directory manually. +If you are using a `Procfile` and importing a `nginx.conf` file, for example: + + web: vendor/bin/heroku-php-nginx -C nginx.conf -i php.ini php/ + +you also need to also add your additional nginx configuration to the `nginx.conf` file, like so: + + client_max_body_size 50m; + location / { + index index.php; + try_files $uri $uri/ /index.php$is_args$args; + } + ## Domains plugin See the [domain configuration documentation](/docs/configuration/domains.md). From 657bb1d2a18c424318ad1932c69c041356e3cc3d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 27 Sep 2017 23:14:23 -0400 Subject: [PATCH 2/2] docs: clarify Procfile/nginx.conf usage [ci skip] --- docs/configuration/nginx.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/configuration/nginx.md b/docs/configuration/nginx.md index 8835dfbbf..4a1776b4f 100644 --- a/docs/configuration/nginx.md +++ b/docs/configuration/nginx.md @@ -201,11 +201,11 @@ service nginx reload The example above uses additional configuration files directly on the Dokku host. Unlike the `nginx.conf.sigil` file, these additional files will not be copied over from your application repo, and thus need to be placed in the `/home/dokku/myapp/nginx.conf.d/` directory manually. -If you are using a `Procfile` and importing a `nginx.conf` file, for example: +For PHP Buildpack users, you will also need to provide a `Procfile` and an accompanying `nginx.conf` file to customize the nginx config *within* the container. The following are example contents for your `Procfile` web: vendor/bin/heroku-php-nginx -C nginx.conf -i php.ini php/ -you also need to also add your additional nginx configuration to the `nginx.conf` file, like so: +Your `nginx.conf` file - not to be confused with Dokku's `nginx.conf.sigil` - would also need to be configured as shown in this example: client_max_body_size 50m; location / { @@ -213,6 +213,8 @@ you also need to also add your additional nginx configuration to the `nginx.conf try_files $uri $uri/ /index.php$is_args$args; } +Please adjust the `Procfile` and `nginx.conf` file as appropriate. + ## Domains plugin See the [domain configuration documentation](/docs/configuration/domains.md).