Hey, everyone.
And welcome back.
Now, in today's video, we will be looking into some of the important command line options that you
will be using extensively in production environment while working with Enginex.
So let's quickly explore them now.
Enginex provides certain command line options that can allow you to perform a specific operation so
you have various options like hyphen, hyphen, Capital V, hyphen T as well as hyphen C, So each one
of them gives you a specific detail.
So for example, hyphen V basically prints the Enginex version hyphen capital V along with the Enginex
version.
It also gives you various details like the compiler version as well as the configuration parameters.
Then you have a hyphen T and you have a hyphen C So before we discuss about this in more detail, let's
quickly explore this.
So currently within the Nginx server, let's go ahead and specify Nginx hyphen V.
Now this as we were discussing, it basically prints the Nginx version that you are running now.
Along with that you can also specify Nginx with hyphen capital V.
Now if you do that it gives you a great detail along with the version.
It also gives you various configuration arguments through which the Nginx was compiled with.
Now we'll be discussing about this in great detail at a later part of the videos.
But just to note that Hyphen V gives you great amount of detail associated with your running Nginx web
server.
Then the next important configuration is the Nginx hyphen.
T.
This is very important.
So basically this tells you whether the configuration that you have within the configuration file is
a proper one or not.
For example, let's go ahead and modify the Nginx configuration file.
All right.
We remove the last curly braces.
So this was an unintentional change.
So the last curly braces was removed.
Let's assume without us knowing now what you did, you did a systemctl restart nginx and as expected,
the nginx restart failed.
And if you do a systemctl status nginx you see your nginx is not working at all.
So this is a very dangerous thing in production environment, your entire traffic will be blocked and
this is one of the reasons why whenever you are modifying the Nginx configuration file, you should
not directly restart your nginx process.
You should always validate if your configuration file tests are successful.
So what you can do, you can do a nginx hyphen t and it will immediately show you if there are any errors
within the configuration file.
So here you see it states that the test has failed and it is stating expecting a curly brace on this
specific path.
So let's do one thing.
Let's go ahead and modify the nginx conf yet again.
We'll add this curly brace if you do a nginx hyphen t now it shows you if it is successful or not.
And once it is successful then maybe you can go ahead and do a systemctl restart.
Nginx.
Great.
Now if we'll quickly do a systemctl status nginx you should see nginx is up and running.
So just to note, whenever you modify any nginx specific configuration file, the first thing that you
should do is to verify if the test are successful.
Only after the tests are successful, then you go ahead and perform the restart operation if it is required.
All right, so if you look into hyphen T, it basically states don't run, just test the configuration
file and you also have a hyphen C, which you can use to specify a configuration file that Nginx should
use instead of the default nginx configuration file.
So in case you have a custom nginx configuration file that you want to quickly test, you can make use
of hyphen C along with that, you can also run Nginx with hyphen H, which basically means health and
it will show you all of the options that are available that you can play around with.
However, in today's video we just looked into some of the important configuration options to understand
the basics of it.
That's great.
So with this, we'll conclude today's video.