How do I set nginx configuration settings on a per app basis in Dokku? How do I set nginx configuration settings on a per app basis in Dokku? nginx nginx

How do I set nginx configuration settings on a per app basis in Dokku?


This question is a bit old, but I ran into it while searching for a solution to the same question.

By default, dokku sites are installed in /home/dokku/{site-name}.

There is one main nginx file per app in this folder, nginx.conf. This file will be replaced every time you deploy so you don't want to change this.

However, you will see that this main nginx.conf file has the following line it in -

  include /home/dokku/{site-name}/nginx.conf.d/*.conf;

Which will include any .conf files in the nginx.conf.d folder.

So you can add a file called upload.conf (for example) to the nginx.conf.d folder, containing just client_max_body_size 50M;, and you'll achieve what you want to do.

After you create the directory and config file, ensure you chown them to the dokku user.

See https://github.com/dokku/dokku/blob/master/docs/configuration/nginx.md for further details.