저는 NGINX에 비교적 익숙합니다. (24 시간 미만) 인정하지만, 기본적으로 구성되었습니다. 친구를위한 사이트를 만들고 있는데, 아래 코드에서와 같이 하위 도메인을 사용하는 코드의 예를 보았습니다. 그러나 하위 도메인에서는 PHP가 작동하지 않습니다. "subdomain.domain.tld"로 이동하면 파일을 다운로드하도록 요청하지만 "subdomain.domain.tld/index.php"로 이동하면 "입력 파일이 지정되지 않았습니다."라고 표시됩니다. 그런데 하위 도메인은 phpmyadmin입니다.NGINX Config PHP 문제
server {
listen 80;
server_name irc.physibots.info;
rewrite (.*) http://physibots.info:3989;
}
server {
listen 80;
server_name "~^([a-z]+)?.physibots.info";
root /home/virtual/physibots.info/subdomains/$1;
index index.php index.html index.html;
location/{
autoindex on;
}
location ~ \.php {
try_files $uri /error.html
fastcgi_index index.php;
fastcgi_pass unix:/tmp/php.socket;
include fastcgi_params;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
#server {
# listen 443;
# server_name localhost;
#
# charset utf-8;
#
# ssl on;
# ssl_certificate
server {
listen 80;
server_name physibots.info default;
root /home/virtual/physibots.info/public_html;
index index.php index.html index.html;
location/{
autoindex on;
}
location ~ \.php {
try_files $uri /error.html
fastcgi_index index.php;
fastcgi_pass unix:/tmp/php.socket;
include fastcgi_params;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
동일한 하위 도메인의 정적 파일에도 액세스하려고 했습니까? 정적 파일이 잘 제공된다면, fastcgi 설정에 문제가 있습니다. 그렇지 않다면 nginx config에 있습니다. :) – petermolnar