Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nginx does not serve image ( 403 - forbidden error )

Tags:

nginx

I just set up an nginx server. I can visit my webpage ( an "under construction" page ), but although one image is server properly by the server ( named "logo.png" ), another image on the same directory ( I have everything under the root directory of nginx ) is not served and throws a "403 - Forbidden" error ). Below I show you the "http" part of my nginx.conf file.

http {

  include       mime.types;
  default_type  application/octet-stream;

  sendfile        on;

  keepalive_timeout  65;

  server {
    listen       80;
    server_name  ***********.com;
    root html;

    location / {
        index  index.html index.htm;
    }
  }
}

Do you have any suggestions about how I might solve this??

like image 620
manosagent Avatar asked Feb 03 '15 13:02

manosagent


People also ask

What does fix 403 Forbidden mean?

Many times the 403 error is temporary, and a simple refresh might do the trick. Most browsers use Ctrl+R on Windows or Cmd+R on Mac to refresh, and also provide a Refresh button somewhere on the address bar.


1 Answers

Probably nginx-user does not have rights to read second file. Options:

1) change chmod of that file so it can be read by everyone

2) add nginx-user and file-owner-user to the same group and allow group to read that file

like image 156
sokoli Avatar answered Sep 28 '22 15:09

sokoli