Męczę się bardzo z konfiguracją obsługi wieloznaczników w nginksie. Ogólnie PHP działa jako fastcgi z PHP-FPM. Cały wynik jaki chcę osiągnąć to po wpisaniu np.:
Kod: Zaznacz cały
konto.domena.pl
Utworzyłem osobny blok:
Kod: Zaznacz cały
server {
listen [::]:80;
server_name *.twojadomena.pl;
root /home/e/public_html;
access_log /home/e/logs/access.log;
error_log /home/e/logs/error.log;
error_page 400 402 403 404 /home/e/errors_html/40x.html;
error_page 500 502 503 504 /home/e/errors_html/50x.html;
index index.html index.php index.htm;
location = /home/e/errors_html/50x.html {
internal;
}
location = /home/e/errors_html/40x.html {
internal;
}
location ~ /\.ht {
deny all;
}
location / {
try_files $uri $uri/ /index.php?/profil/index/$host;
location ~* \.php$ {
if ($uri !~ "^/ftp/")
{
fastcgi_pass 127.0.0.1:9000;
}
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param PATH_INFO $document_uri;
fastcgi_param SCRIPT_FILENAME $request_filename;
error_page 404 /home/e/errors_html/404.html;
}
}
}