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" 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/*;
    default_type  application/octet-stream;
    index         index.html index.htm;
   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"';...
In sites-available/default I haveaccess_log /var/log/nginx/default.access.log 
main; <= This is line 8
error_log /var/log/nginx/default.error.log main;
i think I did things good but it's like the line in nginx.conf is not taken 
into account
Do you know why ?
Regards


_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to