Last active
November 4, 2020 16:58
-
-
Save rizkysyazuli/b01bd4c9d79dae9f46ea34251a4f0c01 to your computer and use it in GitHub Desktop.
[Shell - Nginx Commands] #nginx #centos #ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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