Board logo

标题: [BUG反馈] nginx,N+A组合的WEB引擎中,rewrite功能用不了么? [打印本页]

作者: hotmy    时间: 2017-5-23 17:37     标题: nginx,N+A组合的WEB引擎中,rewrite功能用不了么?

如何设置呢?
作者: hotmy    时间: 2017-5-27 16:29

方法:
1、增加rewrite规则文件
名称:joomla_nginx.conf
内容如下:
  1. if ( $args ~ "mosConfig_[a-zA-Z_]{1,21}(=|\%3d)" ) {
  2. set $args "";
  3. rewrite ^.*$ http://$host/index.php last;
  4. return 403;}

  5. if ( $args ~ "base64_encode.*\(.*\)") {
  6. set $args "";
  7. rewrite ^.*$ http://$host/index.php last;
  8. return 403;}

  9. if ( $args ~ "(\|%3E)") {
  10. set $args "";
  11. rewrite ^.*$ http://$host/index.php last;
  12. return 403;}

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

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

  21. if (!-e $request_filename) {

  22. rewrite (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ /index.php last;
  23. break;
  24. }
复制代码
2、在创建站点或编辑站点的“支持rewrite”选项下选择文件 joomla_nginx.conf
保存即可。

以上内容存档共勉




欢迎光临 WDlinux官方论坛 (http://www.wdlinux.cn/bbs/) Powered by Discuz! 7.2