Skip to content

Commit 1d89eae

Browse files
white space
1 parent b6191b5 commit 1d89eae

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

_posts/2024-11-07-nginx.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ To set up NGINX on your server, follow these steps (using an Ubuntu server as an
6161
2. Set Up Basic Configuration:
6262

6363
- Open the configuration file:
64+
6465
---
6566
sudo nano /etc/nginx/sites-available/default
6667
---
@@ -82,64 +83,78 @@ To set up NGINX on your server, follow these steps (using an Ubuntu server as an
8283
3. Start NGINX:
8384

8485
- After making your changes, start NGINX:
86+
8587
---
8688
sudo systemctl restart nginx
8789
---
8890

8991
4. Test:
9092

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

9395
---
96+
9497
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.
9598

99+
96100
# Some more important commands
101+
97102
- Stopping NGINX
103+
98104
---
99105
sudo systemctl stop nginx
100106
---
101107

102108
- Restarting NGINX
109+
103110
---
104111
sudo systemctl restart nginx
105112
---
106113

107114
- Reloading NGINX Configuration
115+
108116
---
109117
sudo systemctl reload nginx
110118
---
111119

112120
- Checking the Status of NGINX
121+
113122
---
114123
sudo systemctl status nginx
115124
---
116125

117126
- Enabling NGINX on Startup
127+
118128
---
119129
sudo systemctl enable nginx
120130
---
121131

122132
- Disabling NGINX on Startup
133+
123134
---
124135
sudo systemctl disable nginx
125136
---
126137

127138
- Testing the Configuration for Errors
139+
128140
---
129141
sudo nginx -t
130142
---
131143

132144
- Running NGINX as a Background Process
145+
133146
---
134147
sudo nginx
135148
---
136149

137150
- Stopping NGINX without systemd
151+
138152
---
139153
sudo nginx -s stop
140154
---
141155

142156
- Reloading Configuration without Stopping NGINX
157+
143158
---
144159
sudo nginx -s reload
145160
---
@@ -148,16 +163,19 @@ NGINX is an incredibly powerful, fast, and efficient tool for managing web traff
148163

149164
Access error or access logs to diagnose issues. On Ubuntu, logs are typically located at /var/log/nginx/.
150165
- Error log:
166+
151167
---
152168
tail -f /var/log/nginx/error.log
153169
---
154170

155171
- Access log:
172+
156173
---
157174
tail -f /var/log/nginx/access.log
158175
---
159176

160177
- Running in Foreground (without systemd)
178+
161179
---
162180
sudo nginx -g "daemon off;"
163181
---
@@ -170,7 +188,9 @@ NGINX is an incredibly powerful, fast, and efficient tool for managing web traff
170188
---
171189

172190
- Reopening Log Files
191+
173192
---
174193
sudo nginx -s reopen
175194
---
195+
176196
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 commit comments

Comments
 (0)