- NGINX Cookbook
- Tim Butler
- 174字
- 2021-07-03 00:04:21
How it works...
The ngxtop utility can be simply called from the command line, and it will attempt to read the log file location from the configuration. However, if you're running virtual hosts, it may not read the access log location correctly. The easiest way in this scenario is to manually specify the log location.
Consider the following example:
ngxtop -l /var/log/nginx/access.log
This will display a console-based view of what URLs are being accessed. Here's a basic example:

This will refresh every second, giving you near instantaneous information about what URLs NGINX is serving, but that's not all. The ngxtop utility is quite configurable and there are a number of different ways it can display information.
We can filter only the 404 pages with the following:
ngxtop -l /var/log/nginx/access.log --filter 'status == 404'
Only those URLs which had a 404 are now going to be displayed within ngxtop. Here's an example output:

There are quite a number of other options easy to tailor to your scenario, especially if you know what you're hunting for.
- Flask Web全棧開(kāi)發(fā)實(shí)戰(zhàn)
- Mastering Selenium WebDriver
- Mastering Natural Language Processing with Python
- 算法精粹:經(jīng)典計(jì)算機(jī)科學(xué)問(wèn)題的Python實(shí)現(xiàn)
- INSTANT CakePHP Starter
- Python GUI Programming Cookbook
- Python Network Programming Cookbook(Second Edition)
- MySQL數(shù)據(jù)庫(kù)管理與開(kāi)發(fā)(慕課版)
- Unreal Engine 4 Shaders and Effects Cookbook
- Spring核心技術(shù)和案例實(shí)戰(zhàn)
- 硬件產(chǎn)品設(shè)計(jì)與開(kāi)發(fā):從原型到交付
- Learning Unreal Engine Game Development
- Java設(shè)計(jì)模式深入研究
- C語(yǔ)言王者歸來(lái)
- 程序員的英語(yǔ)