joomla1.5 nginx url重写规则

  1. if ( !-e $request_filename ) {
  2. rewrite (/|.php|.html|.htm|.feed|.pdf|.raw|/[^.]*)$ /index.php last;
  3. break;
  4. }
  5. #bellow are anti-attack joomla setting
  6.  
  7. if ( $args ~ "mosConfig_[a-zA-Z_]{1,21}(=|%3d)" ) {
  8. set $args "";
  9. rewrite ^.*$ http://$host/index.php last;
  10. return 403;
  11. }
  12. if ( $args ~ "base64_encode.*(.*)" ) {
  13. set $args "";
  14. rewrite ^.*$ http://$host/index.php last;
  15. return 403;
  16. }
  17. if ( $args ~ "(<|%3C).*script.*(>|%3E)" ) {
  18. set $args "";
  19. rewrite ^.*$ http://$host/index.php last;
  20. return 403;
  21. }
  22. if ( $args ~ "GLOBALS(=|[|%[0-9A-Z]{0,2})" ) {
  23. set $args "";
  24. rewrite ^.*$ http://$host/index.php last;
  25. return 403;
  26. }
  27. if ( $args ~ "_REQUEST(=|[|%[0-9A-Z]{0,2})" ) {
  28. set $args "";
  29. rewrite ^.*$ http://$host/index.php last;
  30. return 403;
  31. }