Portál AbcLinuxu, 12. května 2025 06:40
Dobry den,
uz sa mi konecne podarilo rozchodit nginx s PHP cez fcgi, mam len otazocku.
V konfiguraku je pre PHP cez fcgi nutne:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
davat do kazdeho
server {
server_name www.prvyweb.eu
root /www/prvyweb;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
server {
server_name www.druhyweb.eu
root /www/druhyweb;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
neda sa tento zapis pre php dat iba 1x pre vsetky virtualne weby ?
inak povedane ako to je v lighttpd/apache
Dakujem
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
a na místo toho by pak samotný vhost vypadal takto:
server {
server_name www.prvyweb.eu
root /www/prvyweb;
include /etc/nginx/fcgi-php;
}
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.