T
T
Toopie2018-10-25 16:05:12
Nginx
Toopie, 2018-10-25 16:05:12

How to correctly set paths in nginx?

Hello.
I write in the config:

location / {
  content_by_lua_file /var/www/html/index.lua;
  lua_code_cache off;
}

I planned to make it so that when a person visits the main page (domain.ru/), the index.lua file is executed.
But if I go, for example, to the directory /files (domain.ru/files), then the index.lua file is still executed...
How can I make index.lua be executed only when I go to /?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Softer, 2018-10-25
@Toopie

location = / {
  content_by_lua_file /var/www/html/index.lua;
  lua_code_cache off;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question