全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 2884|回复: 8

[nginx] joomla nginx规则问题

[复制链接]
发表于 2010-8-19 14:33:21 | 显示全部楼层 |阅读模式
location / {
      if ( $args ~ “mosConfig_[a-zA-Z_]{1,21}(=|\%3d)” ) {set $args “”;
        rewrite ^.*$ http://$host/index.php last;
      return 403;}

      if ( $args ~ “base64_encode.*\(.*\)”) {set $args “”;
        rewrite ^.*$ http://$host/index.php last;
      return 403;}

      if ( $args ~ “(\<|%3C).*script.*(\>|%3E)”) {set $args “”;
        rewrite ^.*$ http://$host/index.php last;
      return 403;}

      if ( $args ~ “GLOBALS(=|\[|\%[0-9A-Z]{0,2})”) {set $args “”;
        rewrite ^.*$ http://$host/index.php last;
      return 403;}

      if ( $args ~ “_REQUEST(=|\[|\%[0-9A-Z]{0,2})”) {set $args “”;
        rewrite ^.*$ http://$host/index.php last;
      return 403;}

      if (!-e $request_filename) {
        rewrite (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ /index.php last;
      break;}
    }


网上找到这段,并且放到joomla.conf,在nginx.conf加入了include语句。但joomla1.5开启搜索引擎友好链接后,均无法访问被优化的链接.......

我的joomla放在网站根目录tae文件夹里面
发表于 2010-8-19 14:43:18 | 显示全部楼层
这个要放在
server 段里面。
 楼主| 发表于 2010-8-19 15:10:58 | 显示全部楼层
 楼主| 发表于 2010-8-19 15:24:10 | 显示全部楼层

回复 2# 的帖子

我把那段代码放在nginx.conf的server段里面,重启lnmp,但还是不行.........求解

404 Not Found

--------------------------------------------------------------------------------

nginx/0.7.65
 楼主| 发表于 2010-8-19 15:28:47 | 显示全部楼层
求助啊!!!!!!!!!!!!!
 楼主| 发表于 2010-8-19 17:53:00 | 显示全部楼层
继续求助...........
发表于 2010-8-19 18:29:21 | 显示全部楼层
你折腾啥呀!用逐浪放着apache不用非要用nginx,能快多少?放弃吧
发表于 2010-8-19 22:22:26 | 显示全部楼层
rewrite ^.*$ http://$host/index.php last;
我的joomla放在网站根目录tae文件夹里面

那是不是应该是 rewrite ^.*$ http://$host/tae/index.php last; ?
 楼主| 发表于 2010-8-20 10:10:06 | 显示全部楼层
都试过了,就是不行........
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-16 19:30 , Processed in 0.060183 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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