Mastering Nginx

(Ron) #1

Troubleshooting Techniques


[ 198 ]

What follows is an example of debug_http level output from a single request.


Some comments as to what is going on at each point are interspersed throughout:


<timestamp> [debug] <worker pid>#0: *<connection number> http cl:-1
max:1048576

The rewrite module is activated very early on in the request processing phase:


[debug] #0: * rewrite phase: 3
[debug] #0: * post rewrite
phase: 4
[debug] #0: * generic phase: 5
[debug] #0: * generic phase: 6
[debug] #0: * generic phase: 7

Access restrictions are checked:


[debug] #0: * access phase: 8
[debug] #0: * access: 0100007F
FFFFFFFF 0100007F

The try_files directive is parsed next. The path to the file is constructed from any
string (http script copy) plus the value of any variable (http script var) in the


parameters to the try_files directive:


[debug] #0: * try files phase:
11
[debug] #0: * http script
copy: "/"
[debug] #0: * http script var:
"ImageFile.jpg"

The evaluated parameter is then concatenated with the alias or root for that


location, and the full path to the file is found:


[debug] #0: * trying to use
file: "/ImageFile.jpg" "/data/images/ImageFile.jpg"
[debug] #0: * try file uri: "/
ImageFile.jpg"

Once the file is found, its contents are processed:


[debug] #0: * content phase: 12
[debug] #0: * content phase: 13
Free download pdf