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

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.

主站蜘蛛池模板: 乌鲁木齐市| 桦川县| 淮北市| 禄丰县| 平塘县| 通山县| 永仁县| 巴林左旗| 法库县| 岗巴县| 罗源县| 西充县| 宁城县| 犍为县| 行唐县| 邛崃市| 阳泉市| 海宁市| 威海市| 文山县| 吉木萨尔县| 平昌县| 罗田县| 金寨县| 广德县| 梅河口市| 青岛市| 衡山县| 聊城市| 江城| 长子县| 贵州省| 伊春市| 通渭县| 吴忠市| 隆安县| 瑞金市| 周口市| 潢川县| 离岛区| 平原县|