Skip to content

Instantly share code, notes, and snippets.

@p3t3r67x0
Last active December 27, 2016 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p3t3r67x0/0b0be0120319add82c36 to your computer and use it in GitHub Desktop.
Save p3t3r67x0/0b0be0120319add82c36 to your computer and use it in GitHub Desktop.

Nginx

Test the nginx config

$ sudo nginx -t
$ sudo nginx -t -c /etc/nginx/nginx.conf
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Reload Nginx if the config test was successful

sudo /etc/init.d/nginx configtest && sudo /etc/init.d/nginx reload
alias ngx_config_reload='sudo /etc/init.d/nginx configtest && sudo /etc/init.d/nginx reload'

Check which ports listen e.g. nginx(port 80)

sudo lsof -nP -i | grep LISTEN

Get the amount of cores you have on your setup

grep processor /proc/cpuinfo | wc -l

Show the maximum number of open file descriptors

ulimit -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment