Nginx : configuration d'hôte avec root virtuel

Boris HUISGEN
|
L’intérêt de cette configuration est de gérer plusieurs sites par un unique hôte virtuel.
server
{
listen 127.0.0.1:80;
listen 192.168.0.1:80;
server_name ~(?.+).my.domain$;
root /mnt/home/bhuisgen/www/html/$site;
access_log /mnt/home/bhuisgen/www/logs/access.log main;
error_log /mnt/home/bhuisgen/www/logs/error.log;
index index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /mnt/Users/bhuisgen/Sites/html/$site$fastcgi_script_name;
include fastcgi_params;
}
}