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

  • 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.

主站蜘蛛池模板: 莱阳市| 锡林浩特市| 商洛市| 三穗县| 武强县| 七台河市| 隆安县| 民丰县| 乌拉特中旗| 双牌县| 广汉市| 富顺县| 类乌齐县| 台南市| 洛隆县| 潼关县| 子长县| 孟村| 北川| 米脂县| 澄迈县| 陆丰市| 泰和县| 肇州县| 布尔津县| 资阳市| 盐城市| 汉寿县| 芷江| 卢龙县| 嘉善县| 雷山县| 嵩明县| 怀来县| 奉化市| 霍山县| 米易县| 阿克| 温泉县| 舟山市| 丰城市|