3月 26, 2021 Nginx
> Source: https://serverfault.com/questions/980571/can-i-delete-access-log-files-in-nginx-will-it-cause-an-issue

You can remove access.log as root user, or using sudo.

```sh
sudo rm /var/log/nginx/access.log
```

However after deleting it, the file will not be re-created until nginx is re-loaded or re-started. To reload nginx do:

```sh
sudo service nginx reload
```

To re-size the file to 0 bytes, without having to re-load or re-start nginx, use the truncate command:

```sh
sudo truncate --size 0 /var/log/nginx/access.log
```
過去文章
2025 (9)
4 (5)
3 (1)
2 (3)
2024 (25)
11 (3)
10 (3)
9 (1)
3 (18)
2022 (6)
10 (1)
6 (2)
5 (1)
3 (1)
1 (1)
2021 (21)
11 (7)
7 (1)
6 (2)
5 (2)
4 (6)
3 (2)
2 (1)
2020 (92)
12 (1)
11 (2)
10 (4)
9 (10)
8 (5)
7 (1)
6 (3)
5 (1)
4 (4)
3 (25)
2 (7)
1 (29)
2019 (57)
12 (25)
11 (7)
9 (25)