DEV Community

Cover image for Nginx cheatcheat. List of mostly commonly used nginx commands
kamasuPaul
kamasuPaul

Posted on

2

Nginx cheatcheat. List of mostly commonly used nginx commands

Nginx is known for its use as a web server and a reverse proxy.
It has several commands that can be useful when deploying new sites.

I have written the most commonly used nginx commands list sucthat i or any other person can easily look them up whenever needed.

1. Install nginx command:

sudo apt update
sudo apt install nginx

2. Check if nginx is running:

systemctl status nginx

3. Check for syntax errors in nginx files:

nginx -t

4. Restart nginx:

sudo systemctl restart nginx

5. Create a symlink from sites-available to sites-enabled

sudo ln -s /etc/nginx/sites-available/**your_domain** /etc/nginx/sites-enabled/

6. Start Nginx :

sudo systemctl stop nginx

7. Stop nginx :

sudo systemctl start nginx

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay