Question

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

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?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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