↑ ↓ select, Enter open, Esc close

#nginx

13 one-liners with this tag.

All one-liners tagged nginx

Check the nginx configuration for syntax errors

#nginx -t
harmlessnginx

Check whether nginx is enabled in Plesk

#plesk sbin nginxmng --status
harmlessnginx

Find the cause of a 502 Bad Gateway in the nginx log

#grep -E "upstream|connect\(\) failed" /var/log/nginx/error.log | tail -20
harmlessnginx

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
harmlessLogs

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
harmlessLogs

Regenerate the web server configuration of a domain

#plesk sbin httpdmng --reconfigure-domain example.com
cautionPlesk

Repair a domain's web server configuration with plesk repair

#plesk repair web example.com -y
cautionPlesk

Show all nginx server_name entries with their config file

#nginx -T 2>/dev/null | grep -E "^# configuration file|server_name "
harmlessnginx

Show nginx errors of a Plesk domain (502, 504)

#tail -n 50 /var/www/vhosts/system/example.com/logs/proxy_error_log
harmlessPlesk

Show the additional nginx directives of a Plesk domain

#cat /var/www/vhosts/system/example.com/conf/vhost_nginx.conf
harmlessnginx

Show the nginx configuration Plesk generated for a domain

#cat /var/www/vhosts/system/example.com/conf/nginx.conf
harmlessnginx

Show the nginx version and compiled-in modules

$nginx -V 2>&1 | tr " " "\n" | grep -E "version|_module"
harmlessnginx

Test the nginx configuration and reload only on success

#nginx -t && systemctl reload nginx
cautionnginx

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.