天空小小岛技术论坛

 找回密码
 注册
搜索
查看: 10319|回复: 0
打印 上一主题 下一主题

nginx 白名单运行php 配置方法

[复制链接]
跳转到指定楼层
#
云天一 发表于 2012-2-20 19:31:33 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
Discuz! X1.5为例配置规则
  1. location ~ ^/((api|archiver|uc_server/api)/.*|(install|uc_server)/[^/]+|[^/]+)\.php$ {
  2. # 以下部分请根据服务器的 web 服务 修改
  3.     include fastcgi_params;
  4.     fastcgi_pass  unix:/tmp/php-fcgi.sock;
  5.     fastcgi_index index.php;
  6.     fastcgi_param SCRIPT_FILENAME /data/wwwroot/站点目录$fastcgi_script_name;
  7. # 以上部分请根据服务器的 web 服务 修改
  8. }

  9. location ~ ^/.+\.php$ {
  10.     deny all;
  11. }
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|天空小小岛  |京ICP备2025130156号|

GMT+8, 2025-6-21 16:19 , Processed in 0.093450 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表