<div dir="ltr"><div>Hello,</div><div><br></div><div>I have a nginx multi-user setup that use the same fpm config for all vhost but each vhost has his own user so I had to set a variable in the vhost config to set the fastcgi_pass path in the included file. This way the vhost config is always clean.</div><div><br></div><div>I've read somewhere that variable in vhost is not recommended. What do you think of this setup? It's currently working pretty well so I was wondering.</div><div><br></div><div>Thanks,</div><div>Karl<br></div><div><br></div><div>[root@web ~]# cat /etc/nginx/conf.d/vhosts/exemple.com.conf <br>server {<br>    listen 80;<br>    server_name <a href="http://exemple.com">exemple.com</a>;<br>    root /home/webtest/<a href="http://exemple.com/public_html">exemple.com/public_html</a>;<br>    access_log /var/log/nginx/exemple.com-access_log main;<br>    error_log /var/log/nginx/exemple.com-error_log warn;<br><br>    set $fpmuser webtest;<br><br>    if ($bad_bot) { return 444; }<br><br>    include conf.d/custom/restrictions.conf;<br>    include conf.d/custom/pagespeed.conf;<br>    include conf.d/custom/fpm-wordpress-user.conf;<br>}<br><br><br><br>[root@web ~]# cat /etc/nginx/conf.d/custom/fpm-wordpress-user.conf <br>location / {<br>    rewrite /wp-admin$ $scheme://$host$uri/ permanent;<br>    try_files $uri $uri/ /index.php?$args;<br>}<br><br>location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|woff)$ {<br>    expires 2w;<br>    log_not_found off;<br>}<br><br>location ~* \.(?:css|js)$ {<br>    expires 1w;<br>    add_header Pragma public;<br>    add_header Cache-Control "public";<br>}<br><br>location ~ \.php$ {<br>    try_files $uri =404;<br>    fastcgi_split_path_info ^(.+\.php)(/.+)$;<br>    fastcgi_buffers 8 256k;<br>    fastcgi_buffer_size 256k;<br>    fastcgi_send_timeout 300;<br>    fastcgi_read_timeout 300;<br>    include fastcgi_params;<br>    fastcgi_index index.php;<br>    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br>    fastcgi_pass unix:/run/php-fpm/$fpmuser.sock;<br>}<br></div></div>