Process Flow - Directory listing (autoindex)
Client sends HTTP request
nginx receives request
Check if request targets a directory
Yes / No
autoindex on?
Return file or error
Generate directory listing HTML
Send directory listing to client
Client sees directory contents in browser
When nginx gets a request for a directory, it checks if autoindex is enabled. If yes, it creates and sends a list of files in that directory as an HTML page.