Can't sell the statics to nginx.


  • QA Engineer

    Configurated the server for statics, getting 403 Forbidden.

    My configuration:

    
    worker_processes  1;
    events {
        worker_connections  1024;
    }
    http{
        server{
            location / {
                root /home/danya/Desktop/data/www;
            }
            location /images/ {
                root /home/danya/Desktop/data;
    }   }   }   
    

    Travelled at http/localhost/index.html, http//localhost/home/danya/Desktop/data/www/index.html, http/localhost/home/danya/Desktop/data/images/1.jpg

    [danya@stdfx_arch data]$ tree
    .
    ├── images
    │   ├── 1.jpg
    │   ├── 2.gif
    │   └── 3.png
    └── www
        └── index.html
    

    /home/danya/Desktop/data

    What's the matter? Maybe I've got the statics on the table.



  • User on whose behalf the process began nginxhas no access to the files/catalogs you indicated.

    Options for exit (in order of loss of reasonableness):

    1. Locate files in a more appropriate location (often in) /var/www/and make them the owner of the user on whose behalf the process has been initiated nginx
    2. launch the process nginx On behalf of the user/group who has access (although reading) to the files/catalogs you need.
    3. Change the right of access to the files/catalogs you need so that the user on whose behalf he works. nginxhad access to them at least for reading.

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2