Nginx and PHP-FPM status pages from subdomains

Here are two nginx configurations I am using to get the basic status of the two servers by loading different subdomains:

PHP-FPM status page from subdomain.yoursite.com:

server {
 
  listen 80;
  server_name subdomain.yoursite.com;

  location / {
    rewrite .* /fpm-status;
  }

  location /fpm-status {
    auth_basic "Restricted";
    auth_basic_user_file /path/to/.htpasswd;
    fastcgi_pass 172.17.42.1:9000;
    include fastcgi_params;
  }

}

Nginx status page from subdomain2.yoursite.com:

server {

  listen 80;
  server_name subdomain2.yoursite.com;

  location / {
    auth_basic "Restricted";
    auth_basic_user_file /path/to/.htpasswd;
    stub_status on;
  }

}

Your first app: node.js by Jim Schubert

I started reading the book "Your first app: node.js" by Jim Schubert.It has a good ...

Learn more

About Iliyan Trifonov

Web Developer, Blogger
Tagged , , , , . Bookmark the permalink.