S
S
smartbe2021-04-07 21:48:14
Nginx
smartbe, 2021-04-07 21:48:14

How to make a directory in nginx?

Hello!

Created a file sudo nano /etc/nginx/conf.d/download.conf with this content

server {
  listen 1.1.1.1 (IP VPS сервера для примера);
  location / {
    root /etc/;
    autoindex on;
    autoindex_exact_size off;
    autoindex_localtime on;
  }
}


The question is that when I change root from /etc/ to any custom one, for example /app/, then nginx gives a 404 error. I would like to have a URL that will allow me to navigate through folders outside /etc/. help me please

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question