1. #
  2. # URL Remapping Config File
  3. #
  4. # Using remap.config allows you to accomplish two things:
  5. #
  6. # 1) Rewrite a URL (from the client) before sending it to the Origin Server.
  7. # 2) Protect the proxy server, to only allow certain requests.
  8. #
  9. # With the default configurations, at least one remap rule is required. This
  10. # can be relaxed with the following configuration in records.config:
  11. #
  12. # CONFIG proxy.config.url_remap.remap_required INT 0
  13. #
  14. # Be aware, doing so makes the proxy a generic, open-relay!
  15. #
  16. # The format is:
  17. # <map_type> client-URL origin-server-URL <tag_value> <filtering>
  18. #
  19. # Where client-URL and origin-server-URL are both of the format
  20. # <scheme>://<host>:<port>/<path_prefix>
  21. #
  22. # The <tag_value> directive is optional and can be different for different
  23. # types of <map_type>. The <filtering arguments> are optional ACL-like
  24. # arguments unique for each remap rule
  25. #
  26. # Six different types of mappings are possible:
  27. # map
  28. # map_with_referer
  29. # map_with_recv_port
  30. # reverse_map
  31. # redirect
  32. # redirect_temporary
  33. #
  34. # Each of these map types can be prefixed with the string 'regex_' to indicate
  35. # that the rule will have regular expression strings. See the last part of
  36. # this description for more information on regex support.
  37. #
  38. # The 'map' mapping is the most straightforward. Requests that match the
  39. # client-URL are rewritten into the origin-server-URL. The user agent will see
  40. # the page on the remapped URL, but will not be notified of the address
  41. # change.
  42. #
  43. # The 'map_with_referer' is an extended version of 'map', which can be used to
  44. # activate the so-called "deep linking protection" feature available in
  45. # Apache Traffic Server.
  46. #
  47. # The 'map_with_recv_port' is exactly like 'map' except that it uses the port
  48. # at which the request was received to perform the mapping instead of the port
  49. # present in the request. When present, 'map_with_recv_port' mappings are
  50. # checked first. If there is a match, then it is chosen without evaluating the
  51. # "regular" forward mapping rules.
  52. #
  53. # The 'reverse_map' mapping is used to rewrite location headers sent by the
  54. # origin server. The 'redirect' mapping creates a permanent redirect message
  55. # and informs the browser of the URL change.
  56. #
  57. # The 'redirect_temporary' mapping acts in the same way but tells the browser
  58. # that this redirect is only temporary. We need to map the URL in reverse
  59. # proxy mode so that user agents know to contact Traffic Server and not
  60. # attempt to contact the Origin Server directly.
  61. #
  62. # For example, you can set up a reverse proxy for www.example.com with the
  63. # real content situated at server1.example.com with the rules:
  64. #
  65. # map http://www.example.com/ http://server1.example.com/
  66. # reverse_map http://server1.example.com/ http://www.example.com/
  67. #
  68. # Or you could permanently redirect users trying to access www.oldserver.com
  69. # to www.newserver.com with the following rule:
  70. #
  71. # redirect http://www.oldserver.com/ http://www.newserver.com
  72. #
  73. # If the redirect is only temporary, you want to only temporarily remap the
  74. # URL. You could use the following rule to divert users away from a failed
  75. # server:
  76. #
  77. # redirect_temporary http://broken.firm.com http://working.firm.com
  78. #
  79. # In order to use "deep linking protection" Traffic Server's feature, the
  80. # 'map_with_referer' mapping scheme must be used. In general, the format of is
  81. # the following:
  82. #
  83. # map_with_referer client-URL origin-server-URL redirect-URL regex1 [regex2 ...]
  84. #
  85. # 'redirect-URL' is a redirection URL specified according to RFC 2616 and can
  86. # contain special formatting instructions for run-time modifications of the
  87. # resulting redirection URL. All regexes Perl compatible regular expressions,
  88. # which describes the content of the "Referer" header which must be
  89. # verified. In case an actual request does not have "Referer" header or it
  90. # does not match with referer regular expression, the HTTP request will be
  91. # redirected to 'redirect-URL'.
  92. #
  93. # At least one regular expressions must be specified in order to activate
  94. # 'deep linking protection'. There are limitations for the number of referer
  95. # regular expression strings - 2048. In order to enable the 'deep linking
  96. # protection' feature in Traffic Server, configure records.config with:
  97. #
  98. # CONFIG proxy.config.http.referer_filter INT 1
  99. #
  100. # In order to enable run-time formatting for redirect0URL, configure
  101. #
  102. # CONFIG proxy.config.http.referer_format_redirect INT 1
  103. #
  104. # When run-time formatting for redirect-URL was enabled the following format
  105. # symbols can be used:
  106. #
  107. # %r - to substitute original "Referer" header string
  108. # %f - to substitute client-URL from 'map_with_referer' record
  109. # %t - to substitute origin-server-URL from 'map_with_referer' record
  110. # %o - to substitute request URL to origin server, which was created a
  111. # the result of a mapping operation
  112. #
  113. # Note: There is a special referer type "~*" that can be used in order to
  114. # specify that the Referer header is optional in the request. If "~*" referer
  115. # was used in map_with_referer mapping, only requests with Referer header will
  116. # be verified for validity. If the "~" symbol was specified before referer
  117. # regular expression, it means that the request with a matching referer header
  118. # will be redirected to redirectURL. It can be used to create a so-called
  119. # negative referer list. If "*" was used as a referer regular expression -
  120. # all referers are allowed. Various combinations of "*" and "~" in a referer
  121. # list can be used to create different filtering rules.
  122. #
  123. # Examples:
  124. # map_with_referer http://y.foo.bar.com/x/yy/ http://foo.bar.com/x/yy/ http://games.bar.com/new_games .*\.bar\.com www.bar-friends.com
  125. #
  126. # Explanation: Referer header must be in the request, only ".*\.bar\.com"
  127. # and "www.bar-friends.com" are allowed.
  128. #
  129. # map_with_referer http://y.foo.bar.com/x/yy/ http://foo.bar.com/x/yy/ http://games.bar.com/new_games * ~.*\.evil\.com
  130. #
  131. # Explanation: Referer header must be in the request but all referers are
  132. # allowed except ".*\.evil\.com".
  133. #
  134. # map_with_referer http://y.foo.bar.com/x/yy/ http://foo.bar.com/x/yy/ http://games.bar.com/error ~* * ~.*\.evil\.com
  135. #
  136. # Explanation: Referer header is optional. However, if Referer header exists,
  137. # only request from ".*\.evil\.com" will be redirected to redirect-URL.
  138. #
  139. # There are optional filtering arguments that can be specified at the end of the mapping definition line:
  140. #
  141. # @action=allow|deny
  142. # @src_ip=IP-address
  143. # @method=HTTP method string (CONNECT|DELETE|GET|HEAD|ICP_QUERY|OPTIONS|POST|PURGE|PUT|TRACE|PUSH)
  144. # @plugin=<plugin_path>
  145. # @pparam=<plugin_param>
  146. #
  147. # There is no limitation for the number of filtering arguments.
  148. #
  149. # Example:
  150. # map http://foo.cow.com/ http://bar.cow.com @src_ip=10.72.118.51-10.72.118.62 @method=GET @method=DELETE @src_ip=192.168.0.1-192.168.0.254 @action=allow @method=PUT
  151. #
  152. # Traffic Server supports WebSockets but it must be enabled via remap. WebSocket upgrades are automatically
  153. # detected when there exists a remap rule containing a ws:// scheme.
  154. #
  155. # Example:
  156. # map ws://bar.com/ ws://foo.com/
  157. #
  158. # Explaination: When a request comes in with the appropriate upgrade headers, Traffic Server will use this
  159. # remap rule in an attempt to establish and maintain a websocket connection.
  160. #
  161. # Named filters can be created and applied to blocks of mappings
  162. # using the .definefilter, .activatefilter, and .deactivatefilter
  163. # directives. Named filters must be defined using .definefilter
  164. # before being used. Once defined, .activatefilter can used to
  165. # activate a filter for all mappings that follow until deactivated
  166. # with .deactivatefilter.
  167. #
  168. # Example:
  169. # .definefilter disable_delete_purge @action=deny @method=delete @method=purge
  170. # .definefilter internal_only @action=allow @src_ip=192.168.0.1-192.168.0.254 @src_ip=10.0.0.1-10.0.0.254
  171. #
  172. # .activatefilter disable_delete_purge
  173. #
  174. # map http://foo.example.com/ http://bar.example.com/
  175. #
  176. # .activatefilter internal_only
  177. # map http://www.example.com/admin http://internal.example.com/admin
  178. # .deactivatefilter internal_only
  179. #
  180. # map http://www.example.com/ http://internal.example.com/
  181. #
  182. #
  183. # Regex support: Regular expressions can be specified in the rules with the
  184. # following limitations:
  185. #
  186. # 1) Only the host field can have regexes - the scheme, port and other
  187. # fields cannot.
  188. # 2) The number of capturing sub-patterns is limited to 9;
  189. # this means $0 through $9 can be used as substitution place holders ($0
  190. # will be the entire input string)
  191. # 3) The number of substitutions in the expansion string is limited to 10.
  192. map http://192.168.128.236/cache/ http://{cache}
  193. map http://192.168.128.236/crossdomain.xml http://api.hd.youku.com/crossdomain.xml
  194. #大文件配置创建名为maps.reg的文件
  195. map http://192.168.128.236 http://www.baidu.com @plugin=regex_remap.so @pparam=/usr/local/trafficserver/etc/trafficserver/maps.reg
  196. regex_map http://(.*) http://$1

dnion的remap.conf文件的更多相关文章

  1. initrd image比lvm.conf文件舊導致RHCS切換服務unmount failed,reboot

    在RHCS服務切換的時候,unmount盤的時候,發現會failed,並且直接導致reboot. 在message里看到這樣一段 [lvm] * initrd image needs to be ne ...

  2. VSFTPD全攻略(/etc/vsftpd/vsftpd.conf文件详解)

    /etc/vsftpd/vsftpd.conf文件详解,分好类,方便大家查找与学习 #################匿名权限控制############### anonymous_enable=YE ...

  3. [Android][Audio] audio_policy.conf文件分析

    不同的Android产品在音频的设计上通常是存在差异的,而这些差异可以同过Audio的配置文件audio_policy.conf来获得.在Android系统中音频配置文件存放路径有两处,存放地址可以从 ...

  4. 【转】/etc/grub.conf文件详解

    转自:http://leejia.blog.51cto.com/4356849/788902 grub.conf是grub的主配置文件,通过这个配置文件,grub才能找到kernel,系统才能正常启动 ...

  5. RHEL-resolv.conf文件修改后重启被还原

    修改resolve.conf文件之后,reboot或service restart network时,修改的内容被还原.关闭NetworkManager即可.# chkconfig |grep Net ...

  6. Apache conf文件配置个人总结

      其实说到conf文件的配置,网上那必定是大堆大堆的,故今儿写着篇小博文,也只是做个总结,至于分享的价值吗,如果对屏幕前的你有用,我也很乐意啦.   首先,我们要找到Apache安装目录,我的是Ap ...

  7. 使用Apache + mod_jk + tomcat来实现tomcat集群的负载均衡出现的无法加载mod_jk.conf文件的问题

    用Apache + mod_jk + tomcat来实现tomcat集群的负载均衡的 如果出现了问题,可以用cmd  cd到Apache安装文件的bin下,运行httpd文件,错误信息就会打印出来. ...

  8. sphinx分域搜索【不】需要在conf文件中使用sql_field_string

    请看sql_field_string的文档说明: # combined field plus attribute declaration (from a single column) # stores ...

  9. php解析ini,conf文件

    /** * 解析conf文件,类似ini文件 * @param string $strFileName 文件名 * @param boolean $boolParseVal 解析值为数组,多 * @a ...

随机推荐

  1. 一个vue项目的简单分享

    回首用vue已经2个多月了,今年7月底根据vue社区提供的api写了一个小移动端的小dom 通过这个项目也让我更深入的了解了vue(组件之间的通讯,计算属性,数据绑定.数据驱动....),用数据驱动型 ...

  2. 认识Java中的字符串

    Java 中 String 类的常用方法 Ⅰ String 类提供了许多用来处理字符串的方法,例如,获取字符串长度.对字符串进行截取.将字符串转换为大写或小写.字符串分割等,下面我们就来领略它的强大之 ...

  3. python子域名收集器

    今天心血来潮做了一个子域名收集器.过程是蛋疼啊!这里先感谢一下qpython群的咸鱼大佬,在换页的时候出了点毛病,讲到后面我们就知道了. 思路: 代码开始: 我们要用到的模块是 Requests Bs ...

  4. GSS4 - Can you answer these queries IV(线段树懒操作)

    GSS4 - Can you answer these queries IV(线段树懒操作) 标签: 线段树 题目链接 Description recursion有一个正整数序列a[n].现在recu ...

  5. use ambiguous的错误——编译错误

    出现这样的问题是因为namespace std里面已经有一个count了,而 using namespace std;语句把该namespace 打开了,这导致了后面的引用不明确: 不过这里也可以把u ...

  6. [国嵌攻略][148][MTD系统架构]

    MTD设备概述 Flash在嵌入式系统中是必不可少的,它是bootloader.Linux内核和文件系统的最佳载体.在Linux内核中引入了MTD子系统为NOR Flash和Nand FLash设备提 ...

  7. 番外篇--Moddule Zero启动模板

    1.3 ABPZero - 启动模板 1.3.1 简介 使用ABP和moudle-zero开始一个新项目的最简单的方式是在模板页创建模板.记住要勾选 Include module zero. 在创建并 ...

  8. Oracle_事务

    Oracle_事务 -事物管理   create table account(        id number,        money number );     --实现转账操作 update ...

  9. api接口token验证

    接口特点汇总: 1.因为是非开放性的,所以所有的接口都是封闭的,只对公司内部的产品有效: 2.因为是非开放性的,所以OAuth那套协议是行不通的,因为没有中间用户的授权过程: 3.有点接口需要用户登录 ...

  10. 个人Vue-1.0学习笔记

    dVue.js是类似于angular.js的一套构建用户界面的渐进式框架,只关注视图层, 采用自底向上增量开发的设计. Vue.js的代码需要放置在指定的HTML元素后面. 关于Vue的数据绑定: 例 ...