Report this

What is the reason for this report?

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

Posted on September 30, 2015
Nay

By Nay

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?



This textbox defaults to using Markdown to format your 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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.