Skip to content

Instantly share code, notes, and snippets.

@fprochazka
Created May 3, 2015 16:27
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save fprochazka/70ab2c81bbf563175687 to your computer and use it in GitHub Desktop.
Save fprochazka/70ab2c81bbf563175687 to your computer and use it in GitHub Desktop.
error_log syslog:server=unix:/var/log/nginx.sock;
http {
log_format verbose '$remote_addr - $remote_user $host "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
map $status $loggable {
~^[2] 0;
default 1;
}
map $scheme $server_https {
default off;
https on;
}
access_log syslog:server=unix:/var/log/nginx.sock verbose if=$loggable;
}
$AddUnixListenSocket /var/log/nginx.sock
# access log
$InputFileName /var/log/nginx/access.log
$InputFileTag nginx:
$InputFileStateFile stat-nginx-access
$InputFileSeverity notice
$InputFileFacility local6
$InputFilePollInterval 1
$InputRunFileMonitor
@fprochazka
Copy link
Author

  • nginx.conf -> /usr/local/nginx/conf/nginx.conf
  • rsyslog-nginx.conf -> /etc/rsyslog.d/nginx.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment