0

At an webserver with Nginx and php-fpm and Roundcube I'm seeing entries like this:

2016/10/12 11:22:55 [error] 342342#0: *234242 testing "/some/path" existence failed (20: Not a directory) while logging request, client: xx.xx.xx.xx, server: server.example.org, request: "GET /webmail/?_task=mail&_action=getunread&_remote=1&_unlock=0&_=2422423423 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9001", host: "server.example.org", referrer: "https://server.example.org/foo"

inside error.log of Nginx. What does this line mean?

frlan
  • 573
  • 1
  • 8
  • 27
  • It means that `/some/path` is not a directory where nginx could start writing your log file. I cannot tell you why nginx gives that error message because you give no information about `/some/path`. Include the output of `ls -ld /some/path` and nginx configuration in your question for further help. – Tero Kilkanen Oct 12 '16 at 10:16
  • Well, actually I don't have an explicit logging statement here. Is in such cases alias/root might used in stead for? – frlan Oct 12 '16 at 11:29
  • 1
    There is always some logging set up in nginx. You need to look through the complete configuration, not just the virtual host configuration. – Tero Kilkanen Oct 12 '16 at 12:49
  • I'm aware of. But I meant that there is no special logging setup for this virtual host where apparently the path is coming from. So it's the root of the vhost and it's only used in that vhost. – frlan Oct 12 '16 at 13:08
  • Actually now I read to the end of the line, the request goes into upstream FastCGI, so your web application generates this error. – Tero Kilkanen Oct 12 '16 at 14:33

2 Answers2

2

You have used an access_log directive which contains variables. When you do this, nginx checks for the existence of the document root when logging each request. The root must exist and must be a directory. In this case, the error means that you have set the root to a file, not a directory. To fix the problem, set root to a directory.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
-1

like this ?

2019/06/22 04:40:49 [error] 127592#0: *31196255 testing "/etc/nginx/html" existence failed (2: No such file or directory) while logging request,

I have encountered this problem, in fact, this directory is stored in nginx default html, just like 50x.html, index.html. If you try mkdir /etc/nginx/html , the log will be printed normally.