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

How to do it...

We can enable the basic NGINX stub_status page to give some rudimentary statistics and service status. To enable, edit your site config and add the following:

location = /nginx_status { 
    stub_status on; 
    access_log   off; 
    allow <YOURIPADDRESS>; 
    deny all; 
} 

To prevent information leakage about your system, we have added the allow command. This should be your IP address. This is followed by the deny all command to prevent anyone else from loading the URL. We've also turned off access logs for this URL to save space.

After reloading your configuration (hint: systemctl reload nginx for systemd-based OS), you can now load the new URL /nginx_status in your browser.

You should see something like the following:

主站蜘蛛池模板: 华容县| 来宾市| 黔西县| 大田县| 八宿县| 牙克石市| 长寿区| 宁强县| 察雅县| 旺苍县| 沙坪坝区| 阆中市| 夏邑县| 夏邑县| 额济纳旗| 嘉义县| 武山县| 合山市| 古田县| 永新县| 会同县| 当涂县| 黔西| 望奎县| 凤山市| 九江市| 呼图壁县| 宝丰县| 兴海县| 宁波市| 山阳县| 嘉定区| 上蔡县| 库车县| 舟山市| 柳江县| 包头市| 江口县| 自贡市| 腾冲县| 浪卡子县|