You are not logged in.

#1 2015-04-06 02:55:10

lichar
Member
Registered: 2015-04-06
Posts: 5

Nginx create logs without any directive to do so

Hi,

I've just installed archlinux on a VPS and wish to use nginx. I'm quite familiar with it under ubuntu but I'm running into some troubles on Arch.

The welcome page is visible when reaching the VPS.

First of all, there isn't any directive in /etc/nginx/nginx.conf for access_log but nginx is logging accesses and I can see them in /var/log/nginx/acces.log. How is that possible ? This behaviour comes just after install.


Second, if I add a directive for error_log to something like /var/log/nginx/error.log the file will stay empty even if I create errors on purpose (such as 403 or 404).


Third, doc says "Restart nginx" with restart linked to systemctl. But if I use systemctl restart nginx I'll get an error because I won't be able to enter the passphrase for the key (ssl). Is it bad using `nginx -s reload` ?


I've read nginx archwiki page but I'm wondering if I'm not missing a big information regarding differences in using nginx on arch vs ubuntu (for example).


Thanks !

Last edited by lichar (2015-04-06 02:57:06)

Offline

#2 2015-04-06 19:29:11

lichar
Member
Registered: 2015-04-06
Posts: 5

Re: Nginx create logs without any directive to do so

After some research I managed to make it working. I still don't have an answer to my first point.

Second point :
https://bugs.archlinux.org/task/38011. It's related to nginx 1.4.4-2 but using another error_log file name works well with 1.6.2.

Third point:
I can't use systemd to manager nginx. Service fails to start either if I still have passphrase prompt enable to the ssl key or without ssl because it looks like systemd read '/run/nginx.pid' too soon and therefore raise the error "Invalid PID number". Using basic nginx commands works perfect ('nginx', 'nginx -s reload').
So nginx is working but 'systemctl status nginx.service' show that nginx failed to start :

 Process: 618 ExecStart=/usr/bin/nginx -g pid /run/nginx.pid; error_log stderr; (code=exited, status=1/FAILURE)
 Main PID: 532 (code=exited, status=0/SUCCESS) 

Offline

Board footer

Powered by FluxBB