First of all, hello everyone. This is my first question on this site, I will try to ask better questions, but for now, please forgive me.
When I start my remote server, I get an error. When viewing logs, I see
deploy@rails-deploy:~/www$ sudo cat /var/log/nginx/myapp.error.log
2021/01/09 14:14:09 [error] 11392#11392: *1 open() "/home/deploy/www/public/favicon.ico" failed (2: No such file or directory), client: 95.27.46.9, server: mydomain.com, request: "GET /favicon.ico HTTP/1.1", host: "159.65.205.188"
I tried to fix this error by following the questions found here. Nginx and favicon.ico - "GET /favicon.ico HTTP/1.1" FAILED and nginx: [emerg] "server" directive is not allowed here
Now my nginx. conf looks like this
http {
server {
location = /favicon.ico {
return 204;
access_log off;
log_not_found off;
}
}
#another code
I run sudo nginx -t
but I don't get anything suspicious
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Then I restart
sudo service nginx restart
And I go back to where I started
deploy@rails-deploy:~/www$ sudo cat /var/log/nginx/myapp.error.log
2021/01/09 14:14:09 [error] 11392#11392: *1 open() "/home/deploy/www/public/favicon.ico" failed (2: No such file or directory), client: 95.27.46.9, server: mydomain.com, request: "GET /favicon.ico HTTP/1.1", host: "159.65.205.188"
What am I doing wrong? Or what I didn't understand? I would appreciate any response.
Also, my public already contains a favicon file
Thanks