Forum: NGINX Empty error log

A6662abd951ae246bb4057a37728961b?d=identicon&s=25 chAlx (Guest)
on 2014-01-08 10:08
(Received via mailing list)
I have installed Nginx for a small web server with static content. It
works fine but the site error log file is always empty. All errors such
as 404 are written to the access log only. File grants are the same for
access and error logs.

I've tried to change error_log param from "error" to "warn" and that
didn't help. But changing it to "debug" was successful: log was filled
with debug info (but no error info).

My config files:


/etc/nginx/nginx.conf:

user www;
worker_processes 2;
pid /var/run/nginx.pid;

events {
  worker_connections 768;
}

http {
  sendfile on;
  tcp_nopush on;
  tcp_nodelay on;
  keepalive_timeout 65;
  types_hash_max_size 2048;
  server_tokens off;
  include /etc/nginx/mime.types;
  default_type application/octet-stream;
  access_log /var/log/nginx/access.log;
  error_log /var/log/nginx/error.log;
  gzip on;
  gzip_disable "msie6";
  gzip_min_length 200;
  gzip_types text/plain text/css application/json
application/x-javascript text/xml application/xml application/xml+rss
text/javascript application/rdf+xml;

  include/etc/nginx/conf.d/*.conf;   # None
  include/etc/nginx/sites-enabled/*; # One
}


/etc/nginx/sites-available/mysite.conf:

server {
          listen   80;
          root /var/www/mysite;
          index index.html index.htm;
          server_name mysite.org;
          access_log /var/log/nginx/mysite_access.log combined;
          error_log /var/log/nginx/mysite_error.log error;
          log_subrequest on;
          location / {
                  try_files $uri $uri/ =404;
                  autoindex off;
          }
}
40b4c848b8fcd63b0cb60b9d170c3a77?d=identicon&s=25 Valentin V. Bartenev (Guest)
on 2014-01-08 10:19
(Received via mailing list)
On Wednesday 08 January 2014 13:07:50 chAlx wrote:
> I have installed Nginx for a small web server with static content. It works
> fine but the site error log file is always empty. All errors such as 404
> are written to the access log only. File grants are the same for access and
> error logs.
>
> I've tried to change error_log param from "error" to "warn" and that didn't
> help. But changing it to "debug" was successful: log was filled with debug
> info (but no error info).
>
> My config files:
[..]
>           location / {
>                   try_files $uri $uri/ =404;

You should remove "try_files" directive if you want to see file access
errors
in the error log.

 wbr, Valentin V. Bartenev
B9a22b04b419f4f353f43e753b76d3d2?d=identicon&s=25 wishmaster (Guest)
on 2014-01-08 10:33
(Received via mailing list)
--- Original message ---
 From: "chAlx" <chalx.chalx@gmail.com>
 Date: 8 January 2014, 11:08:35



> worker_processes 2;
> keepalive_timeout 65;
> application/x-javascript text/xml application/xml application/xml+rss
> listen 80;
> root /var/www/mysite;
> index index.html index.htm;
> server_name mysite.org;
> access_log /var/log/nginx/mysite_access.log combined;
> error_log /var/log/nginx/mysite_error.log error;
> log_subrequest on;
> location / {
> try_files $uri $uri/ =404;
> autoindex off;
> }

  Use try_files if you need rewriting rules.

 E.g. http://myshop.com/goods/foo/bar need to be rewritten in
/index.php?router=goods/foo/bar and passed to php-server.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.