- DietPi version | G_DIETPI_VERSION_CORE=8
- Distro version | bullseye
- Kernel version | Linux examen 5.15.76-rockchip64 #22.08.8 SMP PREEMPT Sun Oct 30 10:57:32 CET 2022 aarch64 GNU/Linux
- SBC model | ROCK64 (aarch64)
- Power supply used | 5V 3A switching power supply from Pine64
- SD card used | No SD card used as everything boots off a USB hard drive
- Software title | nginx
- Was the software title installed freshly or updated/migrated? freshly
- Can this issue be replicated on a fresh installation of DietPi? yes
- Open up /etc/nginx/nginx.conf
- Add “access_log /var/log/nginx/access.log;” underneath the error_log config line.
- Restart nginx with
systemctl restart nginx.service
- Nginx fails to start.
systemctl status nginx.servicewhich states
nginx: [emerg] "access_log" directive is not allowed here in /etc/nginx/nginx.conf:22
- Have to remove the access_log config line and then nginx starts fine.
- After setting the
access_logconfig option, nginx should restart/start without any issues, and then /var/log/nginx/access_log would get written to by nginx with log information.
- Nginx will not start with setting the
access_logand therefore the sysadmin will not have any access_log files to look at & to troubleshoot with.
- I experience this same behavior with nginx on other DietPi systems which I have run for over a year. Not sure what needs to be changed to get this to work.
- The error.log is being written fine on all DietPi systems, so not sure why this isn’t working.
Steps to reproducesection works for setting this up on nginx running on other Linux distros.