LKBEN11756: How to test the configuration file from nginx?


Symptom

You need to install nginx and the config file needs to be checked.

Cause

-

Solution

To test the default configuration you can use the following command:

nginx -t

This will test your default configuration file. It will show you the errors and the config file it checked.

Here an example of the output:

nginx: [emerg] cannot load certificate "/etc/pki/nginx/server.crt": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/pki/nginx/server.crt, r) error:10000080:BIO routines::no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed


If you want to check a certain file, you can use:

nginx -t -c /opt/your_config_file.conf

Have fun.

Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!

About the Author

Author: Wim Peeters - Keskon GmbH & Co. KG

Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience, including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform.

Latest update: 04.11.2024