官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 台北市| 本溪市| 华坪县| 怀宁县| 体育| 石城县| 佛学| 德兴市| 札达县| 阿拉善右旗| 海城市| 南丹县| 历史| 苏尼特左旗| 盐源县| 民和| 吴江市| 靖西县| 浪卡子县| 林西县| 华坪县| 都匀市| 航空| 紫云| 抚顺市| 密山市| 泉州市| 福建省| 上高县| 政和县| 上犹县| 乌拉特后旗| 成安县| 南和县| 九龙坡区| 漳州市| 天柱县| 长海县| 仁布县| 铜鼓县| 丘北县|