Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

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
You can’t perform that action at this time.