-
-
Notifications
You must be signed in to change notification settings - Fork 58
Nginx VTS Configuration on Plesk Onyx
Nginx-ee compile Nginx with Nginx VTS module, it provide the ability to display a status page to monitor your virtual host traffic.
Here the steps to configure Nginx VTS module
You can use the command htpasswd to generate your htpasswd file, just replace username in the following command and you will be prompt for the password :
htpasswd -c /etc/nginx/htpasswd username
To enable Nginx VTS module, you just need to add the following line in nginx http{} block :
vhost_traffic_status_zone;
The easiest way to proceed is to add this line inside a file /etc/nginx/conf.d/vts.conf :
echo 'vhost_traffic_status_zone;' >> /etc/nginx/conf.d/vts.conf
Then verify nginx configuration with nginx -t
and reload nginx with service nginx reload
The last step to display Nginx_VTS status page is to configure a subfolder inside a vhost. Choose one of your domain, and in Plesk, go in Apache & Nginx settings > Additional Nginx directives and paste the following content :
location /vts_status {
vhost_traffic_status_display;
vhost_traffic_status_display_format html;
# HTTP authentication || using htpasswd
satisfy any;
auth_basic "Restricted Area";
auth_basic_user_file htpasswd;
# Allowed IP Address List
allow 127.0.0.1;
deny all;
access_log off;
log_not_found off;
}
Apply the configuration. Then you will be able to access to Nginx VTS dashboard by browsing http://yourdomain.tld/vts_status. You will have to enter your login/password previously set inside the htpasswd.