In this video we're going to take a look at inheritance and the three different types of directives
we've already touched on the concept of inheritance.
And you've most likely by now realize that as with scope in a typical programming language an engine
X context inherits configurations from its parent contexts.
This is generally a very straightforward top to bottom inheritance starting at the main context.
The file itself down to that HTP context then the server context and finally any location context.
That said Inheritance isn't always the straight forward and will vary depending on the type of directive
being inherited from the three main directive types.
Is this standard directive the array directive and the action directive.
Now I won't be demonstrating the different types of directives.
As I've previously done with small configuration changes but rather I compiled the sample configuration
with detailed comments explaining how each directive works.
So let's go over that first up.
No one here we have what's called an array type directive.
This is a directive that can be declared multiple times without overriding the previous the axis log
being the perfect example of an array directive array directive sets inherited straight down meaning
all child contexts of this main context will share these log file settings.
For example the server context here.
If I were ever a child context redeclare is this directive at all.
So even only once the parent directive gets overridden completely.
As would be the case here in this site to dot com server context.
This entire context and all it's child context so these locations will have access logs completely disabled.
Unless of course one of these child contexts declares its own access log.
Again and so on.
Then secondly we have this standard directive.
This being the most common directive type and can only be declared once in a given context.
Inheritance working exactly the same as the array directive parent to child with the child being able
to override it with its own declaration.
And finally the third directive type is the action directive.
This being directives that invoke some or other break or action in the configuration for example a redirect
via the return directive a response such as this one also via the return directive or alternatively
a rewrite from either a rewrite or try files directive.
Inheritance simply does not apply to action directives as they stop the normal flow of the configuration.
That covers the three types of directives and the basics of inheritance which again is very important
to understand.
So be sure to download this linked configuration file for reference.