#nginx
13 one-liners with this tag.
All one-liners tagged nginx
Check the nginx configuration for syntax errors
#nginx -t
Check whether nginx is enabled in Plesk
#plesk sbin nginxmng --status
Find the cause of a 502 Bad Gateway in the nginx log
#grep -E "upstream|connect\(\) failed" /var/log/nginx/error.log | tail -20
Find the most requested URLs in the access log
#awk '{print $7}' /var/www/vhosts/system/example.com/logs/access_ssl_log | sort | uniq -c | sort -rn | head -20
Find the top IP addresses in the access log
#awk '{print $1}' /var/www/vhosts/system/example.com/logs/access_ssl_log | sort | uniq -c | sort -rn | head -20
Regenerate the web server configuration of a domain
#plesk sbin httpdmng --reconfigure-domain example.com
Repair a domain's web server configuration with plesk repair
#plesk repair web example.com -y
Show all nginx server_name entries with their config file
#nginx -T 2>/dev/null | grep -E "^# configuration file|server_name "
Show nginx errors of a Plesk domain (502, 504)
#tail -n 50 /var/www/vhosts/system/example.com/logs/proxy_error_log
Show the additional nginx directives of a Plesk domain
#cat /var/www/vhosts/system/example.com/conf/vhost_nginx.conf
Show the nginx configuration Plesk generated for a domain
#cat /var/www/vhosts/system/example.com/conf/nginx.conf
Show the nginx version and compiled-in modules
$nginx -V 2>&1 | tr " " "\n" | grep -E "version|_module"
Test the nginx configuration and reload only on success
#nginx -t && systemctl reload nginx