1
I was trying to configure the serverblocks (vhost) of Nginx, so I deleted the "default" file located in /etc/nginx/sites-enabled/default
and created a file with the name of my site, added these lines below:
server {
listen 80;
root /usr/share/nginx/html;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name http://localhost/;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
And now my site which is in PHP, tested on my server, when I open it, it downloads! I think some line of code that was in the "default" file had something to interpret PHP code?
How to recover this setting?
I guess you just put
location
insideserver
.– Vinícius Gobbo A. de Oliveira
Didn’t solve the problem?
– Marcelo de Andrade