- 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.
- 程序員修煉之道:程序設(shè)計入門30講
- Kali Linux Web Penetration Testing Cookbook
- Visual Basic 6.0程序設(shè)計計算機組裝與維修
- JavaScript 網(wǎng)頁編程從入門到精通 (清華社"視頻大講堂"大系·網(wǎng)絡(luò)開發(fā)視頻大講堂)
- TypeScript項目開發(fā)實戰(zhàn)
- “笨辦法”學(xué)C語言
- Learning iOS Security
- Mobile Forensics:Advanced Investigative Strategies
- AutoCAD基礎(chǔ)教程
- Android高級開發(fā)實戰(zhàn):UI、NDK與安全
- Python 快速入門(第3版)
- Spring Boot學(xué)習(xí)指南:構(gòu)建云原生Java和Kotlin應(yīng)用程序
- Django 3 Web Development Cookbook
- C++面向?qū)ο蟪绦蛟O(shè)計教程
- 你也能看得懂的Python算法書