Skip to content

Commit

Permalink
white space
Browse files Browse the repository at this point in the history
  • Loading branch information
maglovskiNenad committed Nov 7, 2024
1 parent b6191b5 commit 1d89eae
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion _posts/2024-11-07-nginx.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ To set up NGINX on your server, follow these steps (using an Ubuntu server as an
2. Set Up Basic Configuration:

- Open the configuration file:

---
sudo nano /etc/nginx/sites-available/default
---
Expand All @@ -82,64 +83,78 @@ To set up NGINX on your server, follow these steps (using an Ubuntu server as an
3. Start NGINX:

- After making your changes, start NGINX:

---
sudo systemctl restart nginx
---

4. Test:

Visit http://your-server-ip/ in your browser and check if the site is live.
- Visit http://your-server-ip/ in your browser and check if the site is live.

---

NGINX is an incredibly powerful, fast, and efficient tool for managing web traffic. Its advantages, such as high scalability, low resource usage, and flexibility, make it an excellent choice for any web developer or system administrator. Whether you're using it as a web server, reverse proxy, load balancer, or for SSL/TLS termination, NGINX can significantly improve the performance and security of your applications.


# Some more important commands

- Stopping NGINX

---
sudo systemctl stop nginx
---

- Restarting NGINX

---
sudo systemctl restart nginx
---

- Reloading NGINX Configuration

---
sudo systemctl reload nginx
---

- Checking the Status of NGINX

---
sudo systemctl status nginx
---

- Enabling NGINX on Startup

---
sudo systemctl enable nginx
---

- Disabling NGINX on Startup

---
sudo systemctl disable nginx
---

- Testing the Configuration for Errors

---
sudo nginx -t
---

- Running NGINX as a Background Process

---
sudo nginx
---

- Stopping NGINX without systemd

---
sudo nginx -s stop
---

- Reloading Configuration without Stopping NGINX

---
sudo nginx -s reload
---
Expand All @@ -148,16 +163,19 @@ NGINX is an incredibly powerful, fast, and efficient tool for managing web traff

Access error or access logs to diagnose issues. On Ubuntu, logs are typically located at /var/log/nginx/.
- Error log:

---
tail -f /var/log/nginx/error.log
---

- Access log:

---
tail -f /var/log/nginx/access.log
---

- Running in Foreground (without systemd)

---
sudo nginx -g "daemon off;"
---
Expand All @@ -170,7 +188,9 @@ NGINX is an incredibly powerful, fast, and efficient tool for managing web traff
---

- Reopening Log Files

---
sudo nginx -s reopen
---

These commands cover the basics for managing NGINX on a Linux server, including routine maintenance, restarting, testing configurations, and checking the server’s status.

0 comments on commit 1d89eae

Please sign in to comment.