Re: Can't log x-forwarded-for

2016-08-02 Thread Francis Daly
On Tue, Aug 02, 2016 at 11:23:46AM +, Mik J wrote: Hi there, > Thank you very much, it works better, however it works only for access_log > for some reason log_format defines a format that access_log uses. http://nginx.org/r/access_log > nginx.conf > http {log_format   main    '$remote_ad

Re: Can't log x-forwarded-for

2016-08-02 Thread Mik J
Hello Francis, Thank you very much, it works better, however it works only for access_log for some reason nginx.conf http {log_format   main    '$remote_addr forwarded for $http_x_real_ip - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent"';

Re: Can't log x-forwarded-for

2016-08-02 Thread Francis Daly
On Mon, Aug 01, 2016 at 11:25:46PM +, Mik J wrote: Hi there, > nginx: [emerg] unknown log format "main" in /etc/nginx/sites-enabled/default:8 > > in nginx.conf I havehttp { >     include   mime.types; >     include   /etc/nginx/sites-enabled/*; >     include   /etc/nginx/conf.d/*

Can't log x-forwarded-for

2016-08-01 Thread Mik J
nginx version: nginx/1.9.10 Hello,I'm trying to log the client IP within the x-forwarded-for field. http://nginx.org/en/docs/http/ngx_http_log_module.html The only problem is that I think I followed the instructions correctly but nginx won't start# nginx nginx: [emerg] unknown log format "main" i