Answer the question
In order to leave comments, you need to log in
Using variables in the nginx config. Why doesn't $server_name work in error_log and some other directives? What other options?
Actually the whole question is in the title.
We have nginx, it has 100% typical pieces of configs for different hosts on the server, like
location /.well-known/acme-challenge {
alias /srv/www/.well-known/acme-challenge;
}
location / {
return 301 https://$server_name$request_uri;
}
access_log /var/log/nginx/$server_name.access.log;
error_log /var/log/nginx/$server_name.error.log;
Answer the question
In order to leave comments, you need to log in
Everything is simple. The error_log directive does not support variables in file paths.
https://forum.nginx.org/read.php?2,178665,178680#m...
There is no variables support in error_log directive (and it's
unlikely to appear), so "...error_log" file is expected.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question