<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello List! <br>
<br>
I got a question regarding performance of my nginx configuration
files using variables. <br>
Will there be any slow LUA-runtime-parsing if I set a variable
$phpuser inside my server <br>
block and use it afterwards in several common config files.<br>
<br>
Q: Is this a performance disadvantage? <br>
<br>
<blockquote>
<pre>upstream php7_wpexpress_de {
server unix:/var/run/php7.0-fpm-wpexpress_de.sock;
}
server {
set $phpuser "wpexpress_de";
server_name wpexpress.de <a class="moz-txt-link-abbreviated" href="http://www.wpexpress.de">www.wpexpress.de</a>;
access_log /var/log/nginx/wpexpress.de.access.log rt_cache;
error_log /var/log/nginx/wpexpress.de.error.log;
root /var/www/wpexpress.de/htdocs;
index index.php index.html index.htm;
include common/redis-php7.conf;
include common/wpcommon-php7.conf;
include common/locations-php7.conf;
}
</pre>
</blockquote>
In the bottom (three) included config-files I subsequently use <br>
<blockquote>
<blockquote>
<pre>fastcgi_pass php7_$phpuser;</pre>
</blockquote>
</blockquote>
because they do not distinguish per virtual host except for the
php-upstream.<br>
Is this a good approach to separate php processors for each virtual
host or should<br>
I do all configuration better static? Thank you in advance for any
helpfull information,<br>
<br>
Ingo Baab, <a class="moz-txt-link-freetext" href="https://baab.de">https://baab.de</a><br>
______<br>
I did read: <a class="moz-txt-link-freetext"
href="http://nginx.org/en/docs/faq/variables_in_config.html">http://nginx.org/en/docs/faq/variables_in_config.html</a>
and also found guys suggesting a global var with nginx-config
utilizing map:
<a class="moz-txt-link-freetext"
href="http://stackoverflow.com/questions/14433309/how-to-define-a-global-variable-in-nginx-conf-file">http://stackoverflow.com/questions/14433309/how-to-define-a-global-variable-in-nginx-conf-file</a>
</body>
</html>