apache/tomcat桥接器mod_jk URI转发规则

10年01月05日

利用mod_jk桥接apache/tomcat之后会根据设定好的URI规则匹配将特定的请求转发到tomcat或者不转发继续由apache处理:


Inside the URI pattern three special characters can be used, ‘*’, ‘?’ and ‘|’. The character ‘*’ is a wildchar that matches any number of arbitrary characters in the URI, ‘?’ matches exactly one character. Each URI pattern has to start with the character ‘/’, or with ‘*’ or with ‘?’, optionally prefixed by any combination of the modifiers ‘!’ and ‘-’

1
2
3
4
5
6
  # Mapping the URI /myapp1 and everything under /myapp1/:
  /myapp1=myworker-a
  /myapp1/*=myworker-a
  # Mapping all URI which end with a common suffix:
  *.jsp=myworker
  *.do=myworker

Exclusion rules allows to define exclusions from URI rules, which would forward requests to tomcat. If the exclusion rule matches, the request will not be forwarded. This is usually used to serve static content by the web server. A rule is an exclusion rule, if it is suffixed with ‘!’:

1
2
3
4
5
6
  # Mapping the URI /myapp and everything under /myapp/:
  /myapp|/*=myworker
  # Exclude the subdirectory static:
  !/myapp/static|/*=myworker
  # Exclude some suffixes:
  !*.html=myworker

Rule extensions are additional attributes, that can be attached to any rule. They are added at the end of the rule, each extension separated by a semicolon:

1
2
3
4
5
6
7
  # This is an extension example,
  # setting a reply_timeout of 1 minute
  # only for this mapping.
  /myapp=myworker;reply_timeout=60000
  #
  # This is an example using multiple extensions
  /myapp=myloadbalancer;reply_timeout=60000;stopped=member1

相关文章:

  • Tomcat整合Apache,jsp+php(多域名)
  • Tomcat整合Apache,jsp+php
  • FCKeditor集成servlet
  • 编码的错觉
  • 架设自己的java开发框架-控制层设计
  • 原文链接: http://yustar.joomlar.cn/archives/1117.html
  • 转载文章请注明: Yustar’s Blog
  • 分类: linux

    [apache/tomcat桥接器mod_jk URI转发规则]共有:1 条评论

  • uggbestsell :

    Inside the URI pattern three special characters can be used,http://www.uggbestsell.com

  • 发表评论