$(srcdir)/config-solr.xml \
$(srcdir)/config-zoom.xml \
$(srcdir)/config-proxy.xml \
+ $(srcdir)/config-rewrite.xml \
$(srcdir)/retrieval-info.xml
config = example.simple-auth example.target-auth pqf2pqf.xsl explain.xml \
--- /dev/null
+<?xml version='1.0'?>
+<metaproxy xmlns="http://indexdata.com/metaproxy" version="1.0">
+ <start route="start"/>
+ <routes>
+ <route id="start">
+<filter type='http_rewrite'>
+ <request verbose="1">
+ <rule name="null"/>
+ <rule name="url">
+ <rewrite
+ from='(?<proto>https?://)(?<pxhost>[^ /?#]+)/(?<pxpath>[^ /]+)/(?<host>[^ /]+)(?<path>[^ ]*)'
+ to='${proto}${host}${path}' />
+ <rewrite from='(?:Host: )(.*)' to='Host: ${host}' />
+ </rule>
+ <content type="headers">
+ <within header="link" rule="null"/>
+ <within reqline="1" rule="url"/>
+ </content>
+ </request>
+ <response verbose="1">
+ <rule name="null"/>
+ <rule name="url">
+ <rewrite from='foo' to='bar'/>
+ <rewrite from='^cx' to='cy'/>
+ <rewrite
+ from='(?<proto>https?://)(?<host>[^/?# "'>]+)/(?<path>[^ "'>]+)'
+ to='${proto}${pxhost}/${pxpath}/${host}/${path}' />
+ </rule>
+ <content type="headers">
+ <within header="link" rule="url"/>
+ </content>
+ <content type="html" mime="text/xml|text/html">
+ <within tag="body" attr="background" rule="null"/>
+ <within tag="script" attr="#text" type="quoted-literal" rule="url"/>
+ <within tag="style" attr="#text" rule="url"/>
+ <within attr="href,src" rule="url"/>
+ <within attr="onclick" type="quoted-literal" rule="url"/>
+ </content>
+ <content type="quoted-literal" mime=".*javascript">
+ <within rule="url"/>
+ </content>
+ </response>
+</filter>
+ </route>
+ </routes>
+</metaproxy>
filter_frontend_net.rnc \
filter_http_client.rnc \
filter_http_file.rnc \
+filter_http_rewrite.rnc \
+filter_http_rewrite1.rnc \
filter_limit.rnc \
filter_load_balance.rnc \
filter_log.rnc \
--- /dev/null
+# Metaproxy XML config file schema
+
+namespace mp = "http://indexdata.com/metaproxy"
+
+rewrite = element mp:rewrite {
+ attribute from { xsd:string },
+ attribute to { xsd:string }
+}
+
+rule = element mp:rule {
+ attribute name { xsd:string },
+ rewrite*
+}
+
+within = element mp:within {
+ attribute tag { xsd:string }?,
+ attribute attr { xsd:string }?,
+ attribute type { xsd:string }?,
+ attribute header { xsd:string }?,
+ attribute reqline { xsd:string }?,
+ attribute rule { xsd:string }
+}
+
+content = element mp:content {
+ attribute type { xsd:string },
+ attribute mime { xsd:string }?,
+ within*
+}
+
+section = (rule | content)*
+
+filter_http_rewrite =
+ attribute type { "http_rewrite" },
+ attribute id { xsd:NCName }?,
+ attribute name { xsd:NCName }?,
+ element mp:request {
+ attribute verbose { xsd:string },
+ section
+ }?,
+ element mp:response {
+ attribute verbose { xsd:string },
+ section
+ }?
+
include "filter_frontend_net.rnc"
include "filter_http_client.rnc"
include "filter_http_file.rnc"
+include "filter_http_rewrite.rnc"
include "filter_http_rewrite1.rnc"
include "filter_limit.rnc"
include "filter_load_balance.rnc"
| filter_frontend_net
| filter_http_client
| filter_http_file
+ | filter_http_rewrite
| filter_http_rewrite1
| filter_limit
| filter_load_balance