Skip to content

Instantly share code, notes, and snippets.

@ancap
Last active April 6, 2017 00:51
Show Gist options
  • Save ancap/7412407 to your computer and use it in GitHub Desktop.
Save ancap/7412407 to your computer and use it in GitHub Desktop.
Nginx debug

#Nginx debug# Use strace. First, you need to detect PID of nginx process:

# ps ax | grep nginx
25043 ?        Ss     0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
25044 ?        S      0:02 nginx: worker process

Ok, so 25044 is the worker process. Now, we trace it:

# strace -p 25044 2>&1 | grep gz
open("/var/www/css/ymax.css.gz", O_RDONLY|O_NONBLOCK) = 438
open("/var/www/css/patches/patch_my_layout.css.gz", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory)
open("/var/www/yaml/core/iehacks.css.gz", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory)
open("/var/www/js/koznazna5.js.gz", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory)
open("/var/www/css/ymax.css.gz", O_RDONLY|O_NONBLOCK) = 216

As you can see, it is trying to find .gz versions of files.

Exit Ctrl+C

stackoverflow.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment