Hi, I am new to Nginx and trying to setup multiple website in NGINX server in FreeBSD(OS). I created a folder to save my index.html and test.php file with some text in it, in /usr/local/www/website directory . I installed latest version of php and php-fpm is enabled. In PHP-FPM pool configuration file in /usr/local/etc/php-fpm.d/www.conf , uncommented the listen value. my server block looks like this
server{
listen 80
#the code for this server block
}
server {
listen 443 ssl;
server_name example.com www.example.com;
#ssl certificate code here
root /usr/local/www/website;
index test.php index.html;
# Location for PHP files
location ~ \.php$ {
fastcgi_pass unix:127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
when I try to run this website if I just give my domain name its working properly. but if I run domainname/test.php getting bad getawy error(In error log file the error is : No such file or directory while connecting to upstream)
Since I am new to NGINX and FreeBSD I am stuck here. Can anybody faced such issue or If These is any mistake in my step please let me know.
Thank you