{{tag>tutoriel}} ====== Fichier /etc/nginx/sites-available/chateau.parc ====== # Le nom du sous-domaine est mis dans une variable sub, # utilisée ensuite pour définir la racine # Sites dokuwiki #~ server { #~ listen 80; #~ server_name monpc.chateau.parc; #~ root /var/www/html/farmer; #~ location / { #~ index index.php index.html index.htm; #~ try_files $uri $uri/ =404; #~ } #~ location ~ \.php$ { #~ include snippets/fastcgi-php.conf; #~ fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; #~ } #~ location ~ /(data|conf|bin|inc)/ { #~ deny all; #~ } #~ location ~ /\.ht { #~ deny all; #~ } #~ } # Sites dokuwiki server { listen 80; #~ listen 8080; server_name ~^(?Pdoc|perso|perso0|magie|kine)\.chateau\.parc$; root /var/www/html/$sub; location / { index index.php index.html index.htm; try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; } location ~ /(data|conf|bin|inc)/ { deny all; } location ~ /\.ht { deny all; } } # sous-domaines dolibarr server { listen 80; #~ listen 8080; server_name ~^(?Pdolibarr)\.chateau\.parc$; root /var/www/html/$sub/htdocs; location / { index index.php index.html index.htm; try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; } location ~ /\.ht { deny all; } } # Autres sous-domaines server { listen 80; #~ listen 8080; server_name ~^(?P.+)\.chateau\.parc$; root /var/www/html/$sub; location / { index index.php index.html index.htm index.nginx-debian.html; try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; } location ~ /\.ht { deny all; } }