FeaturesWP CloudPricingEE CLIContactMy Account
Features
Team Access & User Permissions
Install
Resources
Community
CLEAR
Tutorials
Nginx
Enable Nginx Status Page
Topics
On this page
-
- Getting Started
- Git and File-System Layout (non-default setup)
- Version Constraints
- Managing Themes and Plugins (for entire WordPress site)
- Updating Themes and Plugins (for entire WordPress site)
- Adding Composer Support to Your Own Themes and Plugins (for developers)
- Using Composer to Manage Own Theme/Plugin Dependencies (for developers)
-
- Assigning Multiple IP Addresses to Single LAN Card
- Disable IPv6 on Ubuntu 12.04
- dsh – distributed shell
- fdupes – find & replace duplicate files with hardlinks
- GPG Keys Cheatsheet
- Increase "Open Files Limit"
- kill all php, nginx, mysql or any kind of processes
- Passwordless Authentication for SSH
- Screen
- search replace in multiple files useing grep xargs sed
- Setup sftp
- sysctl.conf
- Timezone Sync
- Using Google Public DNS on Ubuntu Server
- Using openssl to match private key, cerificate and CSR
- Configure Postfix to Use Gmail SMTP on Ubuntu
- Logrotate Example for Custom Logs
- PHP 5.5, MySQL, Postfix, Nginx and WordPress on Ubuntu
- Serverdensity
- Upgrade Ubuntu 10.04 to 12.04
- Using find and sed to replace strings in multiple files
- Webmin
-
- .my.cnf – mysql user & password
- Analyse slow-query-log using Anemometer
- Improving MySQL Query Cache
- MySQL Query Profiling
- Reset MySQL root password
- tuning-primer.sh – an alternative for mysqltuner
- Using MariaDB 10
- Install/Upgrade to MySQL 5.6 on Ubuntu 12.04 LTS
- Change WordPress Domain Name
- Character Sets and Collations
- Enable innodb_file_per_table
- Enable Remote Access (Grant)
- Installing Percona Toolkit
- Using tmpfs for temporary folder creation
- YARPP and InnoDB
- Convert MyISAM to InnoDB
- Using tmpfs for mysqldump & mysqlimport
- Convert from INNODB to MYISAM
- Analyse slow-query-log using mysqldumpslow & pt-query-digest
- mysqlcheck with cron to optimize automatically
- Using MySQLTuner to Optimize MySQL configuration
-
-
- Directly connect to PHP-FPM
- Generating core-dump for php5-fpm
- GeoIP
- Having php5 and php7 on same system.
- Install Xdebug and configure it with webgrind
- Installation of PHP Code Review Tools
- memcache
- PHP's Zend Opcache Config & Web Viewer
- Setting Sqlite support with PHP
- Using HHVM with PHP-FPM Fallback
- Using Redis for PHP Sessions on Ubuntu Server
- Installing PhpMyAdmin Quickly
- Moving PHP's session storage to tmpfs
- Install Xdebug and configure it with Netbeans
- Nginx – Enable PHP-FPM Status Page
- PHP-FPM: Socket vs TCP/IP and sysctl tweaking
- APC Cache Optimization & Monitoring Using Web Interface
- Checking if PHP/WordPress can send mails
- Debugging PHP Scripts Using slow_log and more
- Increase file upload size limit in PHP-Nginx
- Increase PHP script execution time with Nginx
-
- Performance Optimization
- Remove Query string of css/js files
- Setup ElasticSearch with ElasticPress
- Using Redis for WordPress Object-Cache
- WooCommerce Window Shopping Caching Technique
- Moving WordPress To New Server (Faster)
- Better wp-cron using linux's crontab
- 404 error- Page not Found!!!
- Debugging WordPress with Nginx
Requirement
Nginx Config
Output:
Interpretation
Enable Nginx Status Page
Nginx status page can give realtime data about Nginx’s health. It can help you tweak few Nginx config. Status data can be used in load-balancer env also.
Requirement
Nginx must be compiled with HttpStubStatusModule module. You can check that by running following command:
nginx -V 2>&1 | grep -o with-http_stub_status_module
If you see following output, you are good to go ahead. Otherwise, refer this post to install nginx-full.
with-http_stub_status_module
Nginx Config
You need to add following to a nginx site, say example.com, inside server {..} block.
location /nginx_status {
stub_status on;
access_log off;
allow 1.1.1.1;
deny all;
}
Make sure you replace 1.1.1.1 with your machine’s IP-address. It’s good idea to keep this page accessible to only you.
Output:
Once you codes and reload nginx config, just visit: http://example.com/nginx_status You will see output like below:
Active connections: 43
server accepts handled requests
7368 7368 10993
Reading: 0 Writing: 5 Waiting: 38
Interpretation
-
Active connections – Number of all open connections. This doesn’t mean number of users. A single user, for a single pageview can open many concurrent connections to your server.
-
Server accepts handled requests – This shows three values.
- First is total accepted connections.
- Second is total handled connections. Usually first 2 values are same.
- Third value is number of and handles requests. This is usually greater than second value.
- Dividing third-value by second-one will give you number of requests per connection handled by Nginx. In above example, 10993/7368, 1.49 requests per connections.
-
Reading – nginx reads request header
-
Writing – nginx reads request body, processes request, or writes response to a client
-
Waiting – keep-alive connections, actually it is
active – (reading + writing).This value depends on keepalive-timeout. Do not confuse non-zero waiting value for poor performance. It can be ignored. Although, you can force zero waiting by settingkeepalive_timeout 0;
Website access restriction using nginx
PREVIOUS
Forwarding Visitor's Real-IP + Nginx Proxy/Fastcgi backend correctly
NEXT
Comments
-
Phillip Wilhelm
By adding this /nginx_status to a server block would it only show data for that site or for the entire server?
-
You will get stats for entire Nginx server running that site.
-
-
Steven
Can this be used with Nginx as a reverse proxy? If so, where to enable?
-
Yep.
About “where” – if you want to monitor nginx@proxy, copy-paste above config in nginx@proxy.
If you want to monitor nginx@backend, then copy-paste above config in nginx@backend.
You can also monitor both using different location like `/nginx_status_proxy` and `/nginx_status_backend`.
-
-
deprito
I’m using easy engine.
I try this tutorial to view nginx_status on my site.
But it turns to forbidden. I disable security by comment on ‘allow ip.add.re.ss
But it same.. I got 403 forbidden when i trying access from my site.What must i do to enable it and turn into 200 response. not 403.
Thanks 🙂-
You need to comment out
deny allline.
-
-
A.Er
Compiled and used the added the line to the /sites-enabled/domain.com. Entered the correct ip number too.
But I’m getting a 404 error. All of my site is https. Could this be the problem?
-
404 should not be related to https.
Does it work without https?
-
Features
- Server Setup & Management
- Site Creation & Management
- Create WP Cloud Sites
- Speed & Caching
- Firewall Protection
- Backups & Recovery
- Logs & Monitoring
- Deployments & Developer Tools
- Team Access & User Permissions
Useful Links
Product
Other Products
Subscribe for curated product updates, tips, and announcements.
"*" indicates required fields
This field is for validation purposes and should be left unchanged.
Email*
SIGN ME UP
Δ
© rtCamp, since 2009. All rights reserved.