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

  • NGINX Cookbook
  • Tim Butler
  • 120字
  • 2021-07-03 00:04:21

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:

主站蜘蛛池模板: 宜宾县| 大理市| 红安县| 隆林| 西宁市| 潢川县| 凌海市| 秦皇岛市| 剑川县| 光泽县| 本溪市| 许昌县| 鄂托克前旗| 平阳县| 石柱| 宝丰县| 西贡区| 宁海县| 大渡口区| 青田县| 布尔津县| 瑞金市| 沙坪坝区| 灵川县| 招远市| 祁东县| 乌恰县| 西盟| 忻州市| 杭锦后旗| 安庆市| 永清县| 梓潼县| 延吉市| 伊春市| 佛山市| 孟津县| 淮南市| 托克逊县| 玉门市| 五河县|