Using CustomConfig

Overview

CustomConfig is a tool that allows you to standardise and replicate the configuration of non-containerized components, like proxies and databases, for use in your Maestro application(s).

This guide will introduce you to the concept by showing you how to modify the configuration of an application’s Nginx reverse proxy.

We also have a more detailed guide to CustomConfig including which components are supported and Liquid templating language.

What you’ll need

Before you start, please check you have the following:

Note

This tutorial uses the simple visit counter application we've supplied on Github as a working example.

Editing a template

In this example we’re going to modify the standard Nginx configuration template to increase the number of worker connections your reverse proxy will accept.

To access the Nginx template for your application:

  1. Open the Application Overview from your Dashboard
  2. Click on Configuration files in the Application panel on the right of the screen
  3. Click on the NGINX tab at the top of the Configure Services

We will now use the built-in text editor to make our change to the template:

  1. Look for the worker_connections variable in the file. It should be right near the top - in the first 8 or 10 lines.
  2. Change the value of the variable from 1024 to 2048
  3. Click the green Preview button below the text editor
  4. Check the preview of the file to ensure your change has been made correctly
  5. Add a commit message
  6. Click Commit to Server

Applying configuration changes

Once you have committed your change, your new configuration file will be validated and then automatically applied to Nginx on your server(s).

This works very much like it would do if you updated it manually - it changes the file and then restarts the Nginx process to enable that new configuration.

This process takes place in the background and might take some time to complete depending on the number of servers used by your application and the nature of the configuration change.

Also, during the process, Maestro will update the contents of the CustomConfig git repository for this application. This feature allows you to edit your config files via a git client if you prefer.

Why do we need Preview?

The Preview step exists because CustomConfig files are dynamic - they use a templating language called Liquid that renders different versions of your configuration files depending on the logic encoded in the template. Preview shows you the output of that logic - in other words, the “final” configuration produced by the template.

Important

Preview uses dummy data for some server variables (like the number of cores or the path for different binaries). Refer to our documentation to learn about how the size of your instance affects the number of Nginx workers on your server.

Testing your change

The best way to check whether your change has been applied to your server is to access it directly using SSH. Cloud 66 Toolbelt is the quickest way to do this.

Once you are connected to your server, you can cat your config file. The command will look something like this: cat /etc/nginx/cloud66_nginx.conf and it will print the config file to screen for you to check.

What’s next?