AJBradley
AJBradley

Reputation: 185

Changing Nginx Log File Location

I can't get any changes in the /etc/nginx/nginx.conf http block to be used. I'm starting with the simplest thing - I want to modify the name of access.log to something else (ie a.log). It is a vanilla nginx install (no custom config files yet). Here's what I know:

Here is a snippet of my nginx.conf file:

user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
        worker_connections 768;
}

http {
        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        access_log /var/log/nginx/a.log;
        #....
}

Is it something as simple as I'm modifying an http block that gets overwritten by some other config file? Thanks for the help.

Upvotes: 5

Views: 9179

Answers (1)

Lich4r
Lich4r

Reputation: 1383

Isn't your access_log also defined in a server block ? Have a look at the default config in nginx/sites-enabled/. In this case the value in http block is overwritten by the one in the lower block.

Upvotes: 3

Related Questions