I see that nginx installed with-http_stub_status_module flag, but as I understand stub_status location is disabled by default, which config I should edit for adding this route /stub_status?
Configure Nginx:
In Nginx’s configuration file (usually ‘/etc/nginx/nginx.conf’ or a file contained in the ‘/etc/nginx/conf.d/’ or ‘/etc/nginx/sites-available/’ directory), add the following to enable ‘stub_status’:
server {
listen 80;
server_name _;
location /nginx_status {
stub_status on;
access_log off;
# Restrict access and only allow access from specific IPs
allow 127.0.0.1;
deny all;
}
}
This configuration creates a virtual server that listens on port 80 and enables ‘stub_status’ for the ‘/nginx_status’ path. The ‘allow’ and ‘deny’ directives are used to restrict access to ensure that only specific IP addresses can access the status page.
Restart Nginx:
Once the configuration is complete, restart Nginx to apply the changes:
sudo systemctl restart nginx
Visit ‘stub_status’:
Visit ‘http://your_server_ip/nginx_status’ in your browser and you should be able to see Nginx running status. Please make sure that your server IP address is replaced with ‘your_server_ip’.
2nd question:
If we manually create an nginx configuration file in terminal within /etc/nginx/conf.d/ (instead of editing nginx configuration on the Web panel), would that be permanent, or it would disappear after a big update in HestiaCP?