为了账号安全,请及时绑定邮箱和手机立即绑定

windows下nginx怎么解析html中的php代码?

windows下nginx怎么解析html中的php代码?

尚方宝剑之说 2018-10-28 10:06:00
windows下nginx怎么解析html中的php代码
查看完整描述

1 回答

?
至尊宝的传说

TA贡献1789条经验 获得超10个赞

方式一:打开你的网站的nginx配置文件,然后找到:location ~ \.php$ {,再把其中的\.php修改为:\.php|\.html,保存后重启nginx即可。方式二:同上,打开配置文件找到:location ~ \.php$ {,然后把location整段复制,在下面粘帖上,再把\.php修改为\.html,保存后重启nginx即可生效。上述两种方式的配置示例代码如下:location ~ \.php|\.html$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /webs$fastcgi_script_name; include fastcgi_params; }示例代码二:location ~ \.html$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /webs$fastcgi_script_name; include fastcgi_params; }

查看完整回答
反对 回复 2018-11-19
  • 1 回答
  • 0 关注
  • 1189 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信