Answer the question
In order to leave comments, you need to log in
Pass string from file to Nginx variable?
Hello! The crux of the matter is this. We have nginx without php and everything else. At a certain request, the server gives the file, let it be file1.txt. This file contains the name of the second file, let's say file2.txt. How can I pass the name of the second file to the nginx variable in order to use it later in the server config?
Answer the question
In order to leave comments, you need to log in
Nginx parses the file only when include. In other cases, it simply gives the file without analyzing its content.
If you need to dynamically change variables inside Nginx, then you can use $arg_name (from the request) or $sent_http_name (from the response HEADER).
nginx.org/ru/docs/http/ngx_http_core_module.html#v...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question