WEBVTT

00:00.140 --> 00:00.570
Hey, everyone.

00:00.590 --> 00:01.520
And welcome back.

00:01.520 --> 00:06.080
Now, in today's video, we will be looking into some of the important command line options that you

00:06.080 --> 00:10.310
will be using extensively in production environment while working with Enginex.

00:10.310 --> 00:12.640
So let's quickly explore them now.

00:12.650 --> 00:18.740
Enginex provides certain command line options that can allow you to perform a specific operation so

00:18.740 --> 00:25.340
you have various options like hyphen, hyphen, Capital V, hyphen T as well as hyphen C, So each one

00:25.340 --> 00:27.530
of them gives you a specific detail.

00:27.530 --> 00:34.850
So for example, hyphen V basically prints the Enginex version hyphen capital V along with the Enginex

00:34.850 --> 00:35.240
version.

00:35.240 --> 00:40.940
It also gives you various details like the compiler version as well as the configuration parameters.

00:40.940 --> 00:46.250
Then you have a hyphen T and you have a hyphen C So before we discuss about this in more detail, let's

00:46.250 --> 00:47.600
quickly explore this.

00:47.600 --> 00:53.120
So currently within the Nginx server, let's go ahead and specify Nginx hyphen V.

00:53.390 --> 00:59.030
Now this as we were discussing, it basically prints the Nginx version that you are running now.

00:59.030 --> 01:03.810
Along with that you can also specify Nginx with hyphen capital V.

01:03.960 --> 01:08.250
Now if you do that it gives you a great detail along with the version.

01:08.250 --> 01:14.130
It also gives you various configuration arguments through which the Nginx was compiled with.

01:14.160 --> 01:18.390
Now we'll be discussing about this in great detail at a later part of the videos.

01:18.390 --> 01:25.410
But just to note that Hyphen V gives you great amount of detail associated with your running Nginx web

01:25.410 --> 01:26.010
server.

01:26.040 --> 01:30.030
Then the next important configuration is the Nginx hyphen.

01:30.030 --> 01:30.210
T.

01:30.210 --> 01:31.500
This is very important.

01:31.500 --> 01:37.890
So basically this tells you whether the configuration that you have within the configuration file is

01:37.890 --> 01:38.970
a proper one or not.

01:38.970 --> 01:43.800
For example, let's go ahead and modify the Nginx configuration file.

01:44.040 --> 01:44.580
All right.

01:44.610 --> 01:47.010
We remove the last curly braces.

01:47.130 --> 01:49.470
So this was an unintentional change.

01:49.470 --> 01:51.480
So the last curly braces was removed.

01:51.480 --> 02:01.020
Let's assume without us knowing now what you did, you did a systemctl restart nginx and as expected,

02:01.020 --> 02:03.030
the nginx restart failed.

02:03.030 --> 02:09.720
And if you do a systemctl status nginx you see your nginx is not working at all.

02:09.720 --> 02:15.780
So this is a very dangerous thing in production environment, your entire traffic will be blocked and

02:15.780 --> 02:21.180
this is one of the reasons why whenever you are modifying the Nginx configuration file, you should

02:21.180 --> 02:24.210
not directly restart your nginx process.

02:24.210 --> 02:28.890
You should always validate if your configuration file tests are successful.

02:28.890 --> 02:36.090
So what you can do, you can do a nginx hyphen t and it will immediately show you if there are any errors

02:36.090 --> 02:37.620
within the configuration file.

02:37.620 --> 02:44.130
So here you see it states that the test has failed and it is stating expecting a curly brace on this

02:44.130 --> 02:45.180
specific path.

02:45.180 --> 02:46.320
So let's do one thing.

02:46.320 --> 02:49.410
Let's go ahead and modify the nginx conf yet again.

02:50.550 --> 02:58.680
We'll add this curly brace if you do a nginx hyphen t now it shows you if it is successful or not.

02:58.680 --> 03:04.710
And once it is successful then maybe you can go ahead and do a systemctl restart.

03:04.710 --> 03:05.520
Nginx.

03:05.550 --> 03:06.150
Great.

03:06.180 --> 03:11.820
Now if we'll quickly do a systemctl status nginx you should see nginx is up and running.

03:11.820 --> 03:18.360
So just to note, whenever you modify any nginx specific configuration file, the first thing that you

03:18.360 --> 03:21.960
should do is to verify if the test are successful.

03:21.960 --> 03:28.710
Only after the tests are successful, then you go ahead and perform the restart operation if it is required.

03:28.800 --> 03:33.870
All right, so if you look into hyphen T, it basically states don't run, just test the configuration

03:33.870 --> 03:40.800
file and you also have a hyphen C, which you can use to specify a configuration file that Nginx should

03:40.800 --> 03:43.890
use instead of the default nginx configuration file.

03:43.890 --> 03:48.600
So in case you have a custom nginx configuration file that you want to quickly test, you can make use

03:48.600 --> 03:55.620
of hyphen C along with that, you can also run Nginx with hyphen H, which basically means health and

03:55.620 --> 04:00.690
it will show you all of the options that are available that you can play around with.

04:00.690 --> 04:06.120
However, in today's video we just looked into some of the important configuration options to understand

04:06.120 --> 04:07.290
the basics of it.

04:07.320 --> 04:08.250
That's great.

04:08.250 --> 04:10.950
So with this, we'll conclude today's video.
