remove errors from favicon from nginx server logs

The favicon.ico file is problematic in that IE browsers request it at /favicon.ico before reading your HTTP headers which might specify an alternate location for the file. This generates an error in your NGINX logs. The solution must be done in the server block of NGINX.

Create a "drop.conf" file in nginx to include in each server block

touch /etc/nginx/drop.conf
nano /etc/nginx/drop.conf
# if that gives you an error type "export TERM=xterm" and try again
# paste the following in your "drop.conf" file

location = /favicon.ico { access_log off; log_not_found off; }
location ~ /\. { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }

In your server file include the drop.conf file

nano /etc/nginx/sites-enabled/tendenci-site # where "tendenci-site" is your web name usually

# add the following line after the access_log and error_log but before /static/
include drop.conf;

# close and save your config file with ctl-x then "y" to save

# verify your config
nginx -t

# if all clear then run
service nginx stop
service nginx start

Check your error log to be sure the favicon.ico file (you can make them at http://www.favicon.cc/ ) isn't generating an error and your are done.

cat /var/log/nginx/error.log