# Do not log "directory index of /foo/bar/ is forbidden"

**URL:** <https://www.ruby-forum.com/t/do-not-log-directory-index-of-foo-bar-is-forbidden/242633>\
**Category:** NGINX\
**Created:** [July 9, 2015, 11:58am UTC](https://www.ruby-forum.com/t/do-not-log-directory-index-of-foo-bar-is-forbidden/242633 "2015-07-09T11:58:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [July 9, 2015, 11:58am UTC](https://www.ruby-forum.com/t/do-not-log-directory-index-of-foo-bar-is-forbidden/242633/1 "2015-07-09T11:58:33Z")

</div>

Hello,

I have found “conditional logging” in  
[http://nginx.org/en/docs/http/ngx\_http\_log\_module.html](http://nginx.org/en/docs/http/ngx_http_log_module.html)  
It seems that it only works on status codes.

Is there a way to disable logging for something like:

2015/07/09 11:02:30 [error] 24928#0: \*97983 directory index of  
“/foo/bar/” is forbidden, client: xx.xxx.xx.xx, server: [www.example.com](http://www.example.com),  
request: “GET / HTTP/1.1”, host: “[www.example.com](http://www.example.com)”

nginx version: nginx/1.9.1

Best Regards,  
basti
