forked from membrane/api-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxies.xml
More file actions
59 lines (49 loc) · 1.91 KB
/
proxies.xml
File metadata and controls
59 lines (49 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<spring:beans xmlns="http://membrane-soa.org/proxies/1/"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://membrane-soa.org/proxies/1/ http://membrane-soa.org/schemas/proxies-1.xsd">
<!-- Disable the addition of X-Forwarded* headers -->
<ruleMatching xForwardedForEnabled="false"/>
<router>
<!-- Global plugins that are executed before and after the ones local to an API -->
<global>
<request>
<!-- Filter headers before passing them to the outside -->
<headerFilter>
<!-- Include only headers necessary for functionality and considered safe -->
<include>Accept.*</include>
<include>Cache-Control</include>
<include>Content-Type</include>
<include>Content-Length</include>
<include>Cookie</include>
<include>X-Requested-With</include>
<!-- If you want to pass authentication headers
from the internal clients to the external API
allow them here, otherwise take that line out.
-->
<include>X-Api-Key</include>
<!-- Exclude (remove) all other headers not explicitly included above -->
<exclude>.*</exclude>
</headerFilter>
</request>
</global>
<api port="2000" name="Outgoing API">
<!-- Replace this with the address of the external API -->
<target url="http://localhost:3000"/>
</api>
<!-- Mock for testing and demonstration. Take it out in production -->
<api port="3000" name="External Mock API">
<request>
<log message="Header: ${header}"/>
<template contentType="text/plain" pretty="true">
<![CDATA[
Headers exposed to external API: <%= headers.keySet() %>
]]>
</template>
</request>
<return/>
</api>
</router>
</spring:beans>