- 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.
- Android Wearable Programming
- Docker and Kubernetes for Java Developers
- Apache Oozie Essentials
- 精通Scrapy網絡爬蟲
- Python機器學習基礎教程
- 微信小程序項目開發實戰
- Python極簡講義:一本書入門數據分析與機器學習
- Troubleshooting Citrix XenApp?
- 從零開始學Android開發
- SQL Server 2008中文版項目教程(第3版)
- Bitcoin Essentials
- TensorFlow 2.0深度學習應用實踐
- D Cookbook
- C/C++程序設計教程:面向過程分冊
- Microsoft Hyper-V PowerShell Automation