I tried adding the following to a my_proxy.conf
file that gets mounted into /etc/nginx/conf.d/
in the container as described in https://github.com/jwilder/nginx-proxy#custom-nginx-configuration but the logs aren't making into logstash.
Initially I added this to the conf file:
http {
# Custom log format that also includes the host that processed the request
log_format logstash '$remote_addr - $remote_user [$time_local] "$host" '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
# Send logs to Logstash
access_log syslog:server=logstash:5140,tag=nginx_access logstash;
error_log syslog:server=logstash:5140,tag=nginx_error notice;
}
but when I start the container it tells me "http" directive is not allowed here in /etc/nginx/conf.d/my_proxy.conf:11
So now I just have
# Custom log format that also includes the host that processed the request
log_format logstash '$remote_addr - $remote_user [$time_local] "$host" '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
# Send logs to Logstash
access_log syslog:server=logstash:5140,tag=nginx_access logstash;
error_log syslog:server=logstash:5140,tag=nginx_error notice;
which doesn't get any complaints when starting nginx, but doesn't put anything into logstash either. From here I don't know how to troubleshoot.