我的网站在Apache Server上完美运行。文件以 html 的方式执行。
在这里我的配置文件
cat /etc/nginx/sites-enabled/mydomain.com
server {
listen 80 default_server;
root /usr/share/nginx/mydomain.com/;
index index.php index.phtml index.html index.htm;
server_name domain.com;
location / {
try_files $uri $uri/ /index.php;
}
location ~ .(php|phtml)$ {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include snippets/fastcgi-php.conf;
}
}
请建议如何将" .html"文件求解到nginx中的" .phtml"?
尝试以下:
location ~ .(php|phtml)$ {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include snippets/fastcgi-php.conf;
}