1
2
3
4
5
6
7
8
9
# Do not run, just test the configuration file.
sudo nginx -t

nginx -s signal

# stop — fast shutdown
# quit — graceful shutdown
# reload — reloading the configuration file
# reopen — reopening the log files
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# install
# docker
docker run -d \
--name nginx \
-p 80:80 \
-p 443:443 \
-v nginx-config:/etc/nginx \
-v certbot-conf:/etc/letsencrypt \
-v nginx-www:/var/www \
-v /etc/localtime:/etc/localtime:ro \
--restart=always \
nginx

# podman
podman run -d \
--name nginx \
-p 80:80 \
-p 443:443 \
-v nginx-config:/etc/nginx \
-v certbot-conf:/etc/letsencrypt \
-v nginx-www:/var/www \
-v /etc/localtime:/etc/localtime:ro \
nginx

# nginx config text
docker run --name nginx-config-test --rm -t -a stdout -v nginx-conf:/etc/nginx:ro nginx nginx -c /etc/nginx/nginx.conf -t

# archlinux, mainline branch: new features, updates, bugfixes
sudo pacman -S nginx-mainline

# start
sudo systemctl start nginx

# restart
kill -HUP pid

#stop
kill -s QUIT 1628