How to enable nginx stub status

How to enable nginx stub status

Edit nginx.conf add in the server { ….. } block/context

location /nginx_status {
	# Turn on nginx stats
	stub_status on;

	# I do not need logs for stats
	access_log   off;

	# Security: Only allow access from your IP address #
	allow your ip address;

	# Send rest of the world to /dev/null #
	deny all;
}

For Plesk edit  /etc/nginx/plesk.conf.d/server.conf

Make phpMyAdmin work with Varnish Cache.

How to make phpMyAdmin work on Nginx server with Varnish Cache?

Assuming you have configured Varnish Cache to drop cookies here is what you have to change to make phpMyAdmin work properly on your Nginx server.

  1. after you install phpMyAdmin make a symbolic link
    sudo ln -s /usr/share/phpmyadmin/ /usr/share/nginx/www
  2. edit /etc/varnish/default.vcl – add in  sub vcl_recv
    if (req.url ~ "^/phpmyadmin") {
    return (pass);
    }

    – add in sub vcl_fetch

    if (req.url ~ "^/phpmyadmin") {
    return (hit_for_pass);
    }
  3. edit /etc/phpmyadmin/config.inc.php and set
     $cfg['PmaAbsoluteUri']="http://yourdomain.com/phpmyadmin/";

You can see that it’s not that complicated to make phpMyAdmin work with Varnish Cache.