Nayara
By:
Nayara

I get download of my site after I deleted "default" in /etc/nginx/sites-available! How fix it?

September 30, 2015 1.1k views
PHP Nginx Ubuntu

I deleted the file "default" in that directory /etc/nginx/sites-available and create a new file with the name of my site, but I think the information are incomplete now, because when I access my site in php I get download the site, don't show the page!

How I fix it?

1 Answer

Did you set up nginx to pass php files to php5-fpm? There should be something like this in your nginx virtualhost's config:

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;

        }

If not, install php5-fpm and add the location {} block inside the server {} block and restart Nginx.

sudo apt-get install php5-fpm
Have another answer? Share your knowledge.