L
L
lleballex2020-08-21 17:04:26
Nginx
lleballex, 2020-08-21 17:04:26

Nginx - how to specify a specific file for a URI?

I have a Vue.JS + DRF project . Now I'm setting up Nginx . I need to always call the index.html. I know Nginx has root , alias , try_files . But they do not suit me, it is necessary that index.html. How can this be implemented?
So far I've done this:

location / {
  root /.../frontend;
  try_files /index.html /index.html;
}

This all works, but maybe there is another way to just specify a specific file?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-08-21
@bacon

try_files $uri /index.html;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question