Tiny Core Extensions > TCE Bugs

nginx log path ---core x86 16.x

<< < (2/2)

Zhe:
my nginx.conf works fine when /var/log/nginx is a file.

I suspect the problem might lie elsewhere—it could be that different versions of Nginx lead to different behaviors, or it might be a compilation issue.

andyj:
From the Makefile:

--- Code: ---objs/Makefile: test -d '$(DESTDIR)/var/log/nginx' \
objs/Makefile: || mkdir -p '$(DESTDIR)/var/log/nginx'

--- End code ---

What I don't see is where you are using this path anywhere. It may be that there is a default behavior that is looking for "/var/log/nginx/whatever.log", but when there is no "whatever.log" then what is being checked is "/var/log/nginx" and because "nginx" is the last thing in the path it is being interpreted as a file and not as the directory that it is.

The configured error log path is "--error-log-path=/var/log/nginx/error.log", but "--http-log-path=/var/log/nginx" is given as a directory path and not a file name so it could be misinterpreted as above. I can recompile it with something like "--http-log-path=/var/log/nginx/access.log" and see if that changes what you are seeing.

Rich:
Hi andyj
I ran through it again and can confirm Zhes findings.

Start with a clean  /var/log  directory:

--- Code: ---tc@box:~$ ls -l /var/log
total 208
-rw-r--r--    1 root     staff        58837 Feb 13 10:09 Xorg.0.log
-rw-r--r--    1 root     root             0 Feb 13 10:09 autologin
-rw-r--r--    1 root     root        147372 Feb 13 10:09 messages
-rw-rw-r--    1 root     staff         1536 Feb 13 10:09 wtmp
--- End code ---

Load nginx:

--- Code: ---tc@box:~$ tce-load -i nginx
nginx.tcz: OK
--- End code ---

The  /var/log/nginx  directory is part of the nginx.tcz file structure:

--- Code: ---tc@box:~$ ls -l /var/log
total 212
-rw-r--r--    1 root     staff        58837 Feb 13 10:09 Xorg.0.log
-rw-r--r--    1 root     root             0 Feb 13 10:09 autologin
-rw-r--r--    1 root     root        148146 Feb 13 10:12 messages
drwxr-xr-x    2 root     root            40 Dec 12 02:09 nginx/
-rw-rw-r--    1 root     staff         1536 Feb 13 10:09 wtmp
--- End code ---

/var/log/nginx is empty:

--- Code: ---tc@box:~$ ls -l /var/log/nginx
total 0
--- End code ---

Version and configure options:

--- Code: ---tc@box:~$ nginx -V
nginx version: nginx/1.29.4
built by gcc 14.2.0 (GCC)
built with OpenSSL 3.5.2 5 Aug 2025
TLS SNI support enabled
configure arguments: --prefix=/usr/local --sbin-path=/usr/local/sbin/nginx --modules-path=/usr/local/lib/nginx/modules --conf-path=/usr/local/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/tmp/nginx/lock --user=nobody --group=nogroup --with-threads --with-file-aio --with-compat --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --http-log-path=/var/log/nginx --http-client-body-temp-path=/tmp/nginx/client --http-proxy-temp-path=/tmp/nginx/proxy --http-fastcgi-temp-path=/tmp/nginx/fastcgi --http-uwsgi-temp-path=/tmp/nginx/uwsgi --http-scgi-temp-path=/tmp/nginx/scgi --with-mail=dynamic --with-mail_ssl_module --with-stream=dynamic --with-stream_ssl_module --with-stream_realip_module --with-stream_ssl_preread_module
--- End code ---

Copy all of the .default files to the nginx config directory:

--- Code: ---tc@box:~$ sudo cp /usr/local/etc/nginx/original/*.default /usr/local/etc/nginx/
--- End code ---

Strip the  .default  extension from those files:

--- Code: ---tc@box:~$ for F in /usr/local/etc/nginx/*.default; do sudo mv -- "$F" "${F%.default}"; done
--- End code ---

Try to start nginx:

--- Code: ---tc@box:~$ sudo nginx
nginx: [emerg] open() "/var/log/nginx" failed (21: Is a directory)
--- End code ---

One slight twist. The file was written:

--- Code: ---tc@box:~$ ls -l /var/log/nginx
total 4
-rw-r--r--    1 root     root            91 Feb 13 10:33 error.log
tc@box:~$ cat /var/log/nginx/error.log
2026/02/13 10:33:54 [emerg] 3920#3920: open() "/var/log/nginx" failed (21: Is a directory)
--- End code ---

Rich:
Hi andyj
Could it be this part from  nginx -V:

--- Code: -----http-log-path=/var/log/nginx
--- End code ---

I saw it configured in a build tutorial as:

--- Code: -----http-log-path=/var/log/nginx/access.log
--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version