Ubuntu 16 + nginx + php。下载php文件而不是渲染

时间:2018-06-17 17:45:57

标签: php ubuntu nginx virtualhost

当我尝试基于Ubuntu 16 + nginx + php7.0打开我的网站时,浏览器开始下载index.php文件而不是渲染它。

我的网站可用/默认配置(以DigitalOcean为例)

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www/html;

        index index.php index.html index.htm index.nginx-debian.html;

        server_name mysite.com www.mysite.com;

        location / {
                try_files $uri $uri/ =404;
        }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        }

         location ~ /\.ht {
                deny all;
        }
}

我做错了什么?

0 个答案:

没有答案
相关问题