Q
Q
Quad_Tree2018-02-27 19:45:18
Nginx
Quad_Tree, 2018-02-27 19:45:18

Why is nginx giving 404?

Created a directory for storing images /var/ww/stuff, where the images are located in /var/www/stuff/images. Wrote Location in nginx config file:

location /images/ {
      root /var/www/stuff;
}

Restarted the server. When requesting localhost/images/image.png, it writes 404, although there is /var/www/stuff/images/image.png in the FS.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Vorotnev, 2018-02-27
@Quad_Tree

location /images/- maps the site.com/images/ URL to the folder you specify in the root directive. Accordingly, it should be:

location /images/ {
      root /var/www/stuff/images;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question