Skip to content

Commit 342cb75

Browse files
authored
Create lab2-custom_config.md
1 parent b2c599d commit 342cb75

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

lab2-custom_config.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
backup the original nginx config file - move it to a new name
3+
4+
`sudo mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old`
5+
6+
make new nginx config file with the original name:
7+
8+
`sudo vim /etc/nginx/nginx.conf`
9+
10+
Add the following lines to the config file
11+
12+
> user www-data;
13+
> worker_processes auto;
14+
> pid /run/nginx.pid;
15+
> include /etc/nginx/modules-enabled/*.conf;
16+
>
17+
> events {
18+
> worker_connections 768;
19+
> }
20+
>
21+
> http {
22+
> access_log /var/log/nginx/access.log;
23+
> error_log /var/log/nginx/error.log;
24+
> include /etc/nginx/conf.d/*.conf;
25+
> include /etc/nginx/sites-enabled/*;
26+
>
27+
> server {
28+
> listen 83;
29+
> return 200 "this server listens on 83\n";
30+
> }
31+
> }
32+
33+
save and exit -> `ESC` -> `:x ENTER`
34+
35+
`sudo nginx -s reload` -> to reload the config
36+
37+
`curl localhost:83` to call the server listening on port83
38+
39+
> ubuntu@ip-10-1-1-4:/$ curl localhost:83
40+
> this server listens on 83

0 commit comments

Comments
 (0)