Hey, everyone.
And welcome back.
Now in today's video, we will be discussing about the httpcontext.
Now, just to revise the Httpcontext basically contains the required directives that defines on how
to handle the Http or Https connections and its associated parameters.
So if you look into this Http context block here you have various directives like include log format,
access, log Keepalive, GZip, and so many others.
So in today's video, what we'll be doing, we will primarily be exploring two of these important directives.
First one is the access log and second one is the log underscore format.
Now currently within the Nginx.conf file, if we look into the Http context block here, first important
part here is the access log file.
And basically here you have the path where the access log will be stored.
So let's do one thing.
Let's look into what exactly this log file contains.
So I'll do a list on var log Nginx access dot log, let's press enter.
And here you see that there are multiple logs associated with the request that were made to the Nginx
web server.
Now let's do one thing instead of less.
Let's quickly do a tail hyphen f on this specific file.
Now, at this specific moment, you see that there are no new requests that are coming now from a new
igniter window.
Let me go ahead and paste the IP address of the server and as expected, a default Nginx page got loaded
and corresponding to it.
Here you will see that you also have a specific access log.
Now this specific log request has a format.
So if you look into the format first it is showing us the IP address.
Then it is showing us the timestamp where the request was made.
Then it is showing us the get.
Then it is also showing us details associated with the chrome and the version and various others.
So that is what the access log is all about.
Now the format based on which the actual log is stored is specified in the log underscore format.
Now you might be wondering why it is showing the IP address of the user who has made the request first
and the reason why it is showing it as a first part is because of this specific log format.
Within this log format, it is defined that the remote ID, which is nothing but the IP address of the
remote client, should be the first part of the log request.
Then you also have the timestamp.
So here you see, you have the timestamp and this is the reason why you have a timestamp here.
And then you have various things like request status, body bytes, then you have the Http referrer
user agent and so on.
And based on this, the specific log is generated accordingly.
So again, do note that we have just discussed about this at a very high level overview.
Whenever required, we'll be discussing in great detail associated with the log underscore format directive
and how we can modify it based upon our requirements in the later sections of this course.
So with this, we'll conclude today's video.