I have a server with two websites, A and B. The nginx configuration for my server is quite basic:
server {
listen 80;
server_name <url>;
location / {
proxy_pass http://localhost:<port>;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Both websites are served just fine, with the exception of website B, who displays the favicon of website A. It works, however, if I try to access website B using <ip address>:<port>
, so I am pretty sure it's an nginx configuration issue.
I tried all sorts of variants of:
location /favicon.ico {
alias ~/<project folder>/favicon.ico;
}
to no avail.
My server runs on ubuntu 16.04, and my websites run on NodeJS.
UPDATE:
I checked the nginx logs and found this:
2017/03/07 22:05:58 [error] 7013#7013: *10 open() "
/root/<project_folder>/favicon.ico
" failed (13: Permission denied), client: 37.59.63.164, server:<url>
, request: "GET /favicon.ico HTTP/1.1", host: "<url>
"
So I guess this is a permission issue on this file. However, I don't understand why this file in particular, as it works for the rest of the folder (including statics) and on the favicon of my second website.