Skip to content

Instantly share code, notes, and snippets.

@rizkysyazuli
Last active November 4, 2020 16:58
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 rizkysyazuli/b01bd4c9d79dae9f46ea34251a4f0c01 to your computer and use it in GitHub Desktop.
Save rizkysyazuli/b01bd4c9d79dae9f46ea34251a4f0c01 to your computer and use it in GitHub Desktop.
[Shell - Nginx Commands] #nginx #centos #ubuntu
# Start
sudo systemctl start nginx
sudo service nginx start
# Stop
sudo systemctl stop nginx
sudo service nginx stop
# Restart
sudo systemctl restart nginx
sudo service nginx restart
# Reload
sudo systemctl reload nginx
sudo service nginx reload
# Check status
sudo systemctl status nginx
sudo service nginx status
# Built-in commands
nginx -s reload
nginx -s stop
# Config check
nginx -t
# Check active sites
nginx -T | grep "server_name "
# Configs locations
/etc/nginx/conf.d/
/etc/nginx/sites-available/
# Enable server block
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment