Process Flow - Directives and blocks
Start parsing config
Read directive or block
If directive
Execute directive→Continue
If block start
Enter block context→Parse inner directives
Block end found?
No→Parse inner directives
Yes
Exit block context
→Continue
End of config file
Nginx reads each line as a directive or block start. Directives execute immediately. Blocks open a new context to parse nested directives until the block ends.