Chapter 18. Practical Ops Tips and Conclusion
18.0 Introduction
This last chapter will cover practical operations tips and is the conclusion to this book. Throughout this book, we’ve discussed many concepts pertinent to operations engineers. However, I thought a few more ideas might be helpful to round things out. In this chapter, I’ll cover making sure your configuration files are clean and concise, as well as debugging configuration files.
18.1 Using Includes for Clean Configs
Problem
You need to clean up bulky configuration files to keep your configurations logically grouped into modular configuration sets.
Solution
Use the include directive to reference configuration files, directories, or masks:
http {
include config.d/compression.conf;
include sites-enabled/*.conf
}
The include directive takes a single parameter of either a path to a file or a mask that matches many files. This directive is valid in any context.
Discussion
By using include statements you can keep your NGINX configuration clean and concise. You’ll be able to logically group your configurations to avoid configuration files that go on for hundreds of lines. You can create modular configuration files that can be included in multiple places throughout your configuration to avoid duplication of configurations. Take the example fastcgi_param configuration file provided in most package management installs of NGINX. If you manage multiple FastCGI virtual servers on a single NGINX box, you can include ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access