#
# URL Remapping Config File
#
# Using remap.config allows you to accomplish two things:
#
# 1) Rewrite a URL (from the client) before sending it to the Origin Server.
# 2) Protect the proxy server, to only allow certain requests.
#
# With the default configurations, at least one remap rule is required. This
# can be relaxed with the following configuration in records.config:
#
# CONFIG proxy.config.url_remap.remap_required INT 0
#
# Be aware, doing so makes the proxy a generic, open-relay!
#
# The format is:
# <map_type> client-URL origin-server-URL
#
# Where client-URL and origin-server-URL are both of the format
# <scheme>://<host>:<port>/<path_prefix>
#
# Six different types of mappings are possible:
# map [with_recv_port | reverse]
# redirect [temporary]
#
# the rule can have regular expression strings. See the last part of
# this description for more information on regex support.
#
# The 'map' mapping is the most straightforward. Requests that match the
# client-URL are rewritten into the origin-server-URL. The user agent will see
# the page on the remapped URL, but will not be notified of the address
# change.
#
# The 'map with_recv_port' is exactly like 'map' except that it uses the port
# at which the request was received to perform the mapping instead of the port
# present in the request. When present, 'map with_recv_port' mappings are
# checked first. If there is a match, then it is chosen without evaluating the
# "regular" forward mapping rules.
#
# The 'map reverse' mapping is used to rewrite location headers sent by the
# origin server. The 'redirect' mapping creates a permanent redirect message
# and informs the browser of the URL change.
#
# The 'redirect temporary' mapping acts in the same way but tells the browser
# that this redirect is only temporary. We need to map the URL in reverse
# proxy mode so that user agents know to contact Traffic Server and not
# attempt to contact the Origin Server directly.
#
# For example, you can set up a reverse proxy for www.example.com with the
# real content situated at server1.example.com with the rules:
#
# map http://www.example.com/ http://server1.example.com/
# map reverse http://server1.example.com/ http://www.example.com/
#
# Or you could permanently redirect users trying to access www.oldserver.com
# to www.newserver.com with the following rule:
#
# redirect http://www.oldserver.com/ http://www.newserver.com
#
# If the redirect is only temporary, you want to only temporarily remap the
# URL. You could use the following rule to divert users away from a failed
# server:
#
# redirect temporary http://broken.firm.com http://working.firm.com
#
# 'redirect-URL' is a redirection URL specified according to RFC 2616 and can
# contain special formatting instructions for run-time modifications of the
# resulting redirection URL. All regexes Perl compatible regular expressions,
# which describes the content of the "Referer" header which must be
# verified. In case an actual request does not have "Referer" header or it
# does not match with referer regular expression, the HTTP request will be
# redirected to 'redirect-URL'.
#
# At least one regular expressions must be specified in order to activate
# 'deep linking protection'. There are limitations for the number of referer
# regular expression strings - 2048. In order to enable the 'deep linking
# protection' feature in Traffic Server, configure records.config with:
#
# CONFIG proxy.config.http.referer_filter INT 1
#
# In order to enable run-time formatting for redirect0URL, configure
#
# CONFIG proxy.config.http.referer_format_redirect INT 1
#
# When run-time formatting for redirect-URL was enabled the following format
# symbols can be used:
#
# %r - to substitute original "Referer" header string
# %f - to substitute client-URL from 'map' record
# %t - to substitute origin-server-URL from 'map' record
# %o - to substitute request URL to origin server, which was created a
# the result of a mapping operation
#
#
# Regex support: Regular expressions can be specified in the rules with the
# following limitations:
#
# 1) Only the host field can have regexes - the scheme, port and other
# fields cannot.
# 2) The number of capturing sub-patterns is limited to 9;
# this means $0 through $9 can be used as substitution place holders ($0
# will be the entire input string)
# 3) The number of substitutions in the expansion string is limited to 10.
#
#
# acl define allow_specified_client_access allow {
src_ip 0.0.0.0-255.255.255.255
} acl define deny_all_client_access deny {
src_ip 0.0.0.0-255.255.255.255
} acl define allow_only_administrator_access allow {
src_ip 127.0.0.1
src_ip 10.254.33.20
} http 10.254.33.20:8828 {
acl check allow_only_administrator_access
acl check deny_all_client_access
map /cache-internal/ http://{cache-internal}
map /cache/ http://{cache}
map /stat/ http://{stat}
map /test/ http://{test}
map /hostdb/ http://{hostdb}
map /net/ http://{net}
map /http/ http://{http}
map /migrate/ http://{migrate}
} map http://(.+)/ http://$1/ {
acl check allow_specified_client_access
acl check deny_all_client_access
} map http://(.+):9999/ http://$1:9999/ {
acl check allow_specified_client_access
acl check deny_all_client_access
} map https://(.+)/ https://$1/ {
acl check allow_specified_client_access
acl check deny_all_client_access
} map http://(.+):81/ http://$1:81/ {
acl check allow_specified_client_access
acl check deny_all_client_access
} map http://(.+):82/ http://$1:82/ {
acl check allow_specified_client_access
acl check deny_all_client_access
} map http://(.+):443/ http://$1:443/ {
acl check allow_specified_client_access
acl check deny_all_client_access
} map http://(.+):8080/ http://$1:8080/ {
acl check allow_specified_client_access
acl check deny_all_client_access
} map http://(.+):8081/ http://$1:8081/ {
acl check allow_specified_client_access
acl check deny_all_client_access
} map http://(.+):8090/ http://$1:8090/ {
acl check allow_specified_client_access
acl check deny_all_client_access
} map http://(.+):9080/ http://$1:9080/ {
acl check allow_specified_client_access
acl check deny_all_client_access
}

remap.config文件配置模板的更多相关文章

  1. records.config文件配置模板

    # # # Process Records Config File # # <RECORD-TYPE> <NAME> <TYPE> <VALUE (till ...

  2. cache.config文件配置模板

    # # cache.config # # The purpose of this file is to alter caching parameters of # specific objects o ...

  3. c#Winform程序调用app.config文件配置数据库连接字符串 SQL Server文章目录 浅谈SQL Server中统计对于查询的影响 有关索引的DMV SQL Server中的执行引擎入门 【译】表变量和临时表的比较 对于表列数据类型选择的一点思考 SQL Server复制入门(一)----复制简介 操作系统中的进程与线程

    c#Winform程序调用app.config文件配置数据库连接字符串 你新建winform项目的时候,会有一个app.config的配置文件,写在里面的<connectionStrings n ...

  4. SSH自动登录config文件配置

    title: SSH自动登录config文件配置 comments: false date: 2019-08-19 19:29:13 description: 更方便的 ssh 操作??? categ ...

  5. C# app.config文件配置和修改

    很多时候我们需要对系统的.config文件进度读写操作,例如:系统初始化的参数的更改.系统参数的改变都需要更新到配置文件. 首先我们有必要了解一下app.config.exe.config和vshos ...

  6. 跨域Ajax请求 web.config文件配置

    在web.config文件的<system.webServer>节点下面添加如下配置代码:<!--允许跨域ajax访问--> <httpProtocol> < ...

  7. Web.Config文件配置之限制上传文件大小和时间

    在邮件发送系统或者其他一些传送文件的网站中,用户传送文件的大小是有限制的,因为这样不但可以节省服务器的空间,还可以提高传送文件的速度.下面介绍如何在Web.Config文件中配置限制上传文件大小与时间 ...

  8. 通过config文件配置动态导入模块

    需求: 固定的服务中要调用不同的算法,当前服务中实现的动态导入是通过在config配置中加上参数:proto="AiProto(1,4)",在服务中from pathname im ...

  9. Winform 数据库连接app.config文件配置 数据库连接字符串

    1.添加配置文件 新建一个winform应用程序,类似webfrom下有个web.config,winform下也有个App.config;不过 App.config不是自动生成的需要手动添加,鼠标右 ...

随机推荐

  1. Nginx概述和安装(1)

    一.Nginx概述 Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器. Nginx 是由 I ...

  2. Zedboard(二)使用Vivado+SDK开发嵌入式应用程序——实例一

    本次介绍用Vivado构建Zedboard开发板的硬件平台+SDK开发应用程序(Zedboard裸机开发) 过程如下: 一.运行Vivado,建立新工程 指定好工程路径,下一步,选择RTL Proje ...

  3. Django----->一周后的重温

    Django   一 什么是web框架? 框架,即framework,特指为解决一个开放性问题而设计的具有一定约束性的支撑结构,使用框架可以帮你快速开发特定的系统,简单地说,就是你用别人搭建好的舞台来 ...

  4. 洛谷 P1914 小书童——密码【字符串+模拟】

    P1914 小书童——密码 题目背景 某蒟蒻迷上了“小书童”,有一天登陆时忘记密码了(他没绑定邮箱or手机),于是便把问题抛给了神犇你. 题目描述 蒟蒻虽然忘记密码,但他还记得密码是由一串字母组成.且 ...

  5. 几道数位DP

    因为这几天写的几道数位DP大多都太水..而且也确实没什么好讲所以就扔到一起了. [hdu4772]Good Numbers 要求统计区间内 各位数之和能被10整除 的数的个数. 练手,f[i][j][ ...

  6. UVA10341-Solve It-二分查找

    二分查找 二分查找又称折半查找,优点是比较次数少,查找速度快,平均性能好:其缺点是要求待查表为有序表,且插入删除困难.因此,折半查找方法适用于不经常变动而查找频繁的有序列表.首先,假设表中元素是按升序 ...

  7. input框type=file设置cursor:pointer的问题

    为了让美化上传文件框,设置了cursor:pointer;,然而不起作用,然后百度找到了解决方法,设置font-size:0,这样就可以了.

  8. java小入门的感觉

    工作两三年,.NET与Java都干过,也都是应付差事,用着现有的框架,现有的规范,实现简单的功能,有余力的情况下,看看框架中的代码,欣赏一下前辈们的心血,居然在单位也算有心的了?! 最近的JAVA项目 ...

  9. 分布式监控系统--zabbix

    1Zabbix简介 Zabbix 是一个企业级的分布式开源监控方案. 2.监控系统架构 C/S架构 客户端/服务器端,这种架构适合规模较小,处于同一地域的环境 C/P/S 客户端/代理端/服务器端/, ...

  10. 修改织梦默认栏目页、文章页URL命名规则,简化目录结构

    版权声明:本文为博主原创文章,未经博主允许不得转载. 用织梦Dedecms建站,建议优化系统默认的URL结构,这样能简化网站目录深度,利于搜索引擎收录. 现在织梦的默认文章命名规则是 {typedir ...