|
| 1 | +<!-- |
| 2 | + Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | + contributor license agreements. See the NOTICE file distributed with |
| 4 | + this work for additional information regarding copyright ownership. |
| 5 | + The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | + (the "License"); you may not use this file except in compliance with |
| 7 | + the License. You may obtain a copy of the License at |
| 8 | +
|
| 9 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +
|
| 11 | + Unless required by applicable law or agreed to in writing, software |
| 12 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + See the License for the specific language governing permissions and |
| 15 | + limitations under the License. |
| 16 | +--> |
| 17 | +<rules> |
| 18 | + <rule dir="IN" name="AMBARIUI/ambari/inbound/root" pattern="*://*:*/**/ambari/"> |
| 19 | + <rewrite template="{$serviceUrl[AMBARIUI]}/"/> |
| 20 | + </rule> |
| 21 | + <rule dir="IN" name="AMBARIUI/ambari/inbound/path" pattern="*://*:*/**/ambari/{**}"> |
| 22 | + <rewrite template="{$serviceUrl[AMBARIUI]}/{**}"/> |
| 23 | + </rule> |
| 24 | + <rule dir="IN" name="AMBARIUI/ambari/inbound/query" pattern="*://*:*/**/ambari/{**}?{**}"> |
| 25 | + <rewrite template="{$serviceUrl[AMBARIUI]}/{**}?{**}"/> |
| 26 | + </rule> |
| 27 | + |
| 28 | + <rule dir="OUT" name="AMBARIUI/ambari/outbound/sitepath"> |
| 29 | + <rewrite template="/gateway/{$frontend[topology]}/ambari"/> |
| 30 | + </rule> |
| 31 | + |
| 32 | + <rule dir="OUT" name="AMBARIUI/ambari/outbound/extrapath"> |
| 33 | + <rewrite template="/gateway/{$frontend[topology]}/ambari/api/v1"/> |
| 34 | + </rule> |
| 35 | + |
| 36 | + <rule dir="OUT" name="AMBARIUI/ambari/outbound/img"> |
| 37 | + <rewrite template="/gateway/{$frontend[topology]}/ambari/img/"/> |
| 38 | + </rule> |
| 39 | + |
| 40 | + <rule dir="OUT" name="AMBARIUI/ambari/outbound/ambarilogo"> |
| 41 | + <rewrite template="/gateway/{$frontend[topology]}/ambari/img/ambari-logo.png"/> |
| 42 | + </rule> |
| 43 | + |
| 44 | + <rule dir="OUT" name="AMBARIUI/ambari/outbound/logohref"> |
| 45 | + <rewrite template="#/main/dashboard"/> |
| 46 | + </rule> |
| 47 | + |
| 48 | + <rule dir="OUT" name="AMBARIUI/ambari/outbound/vendorcss"> |
| 49 | + <rewrite template="/gateway/{$frontend[topology]}/ambari/stylesheets/vendor.css"/> |
| 50 | + </rule> |
| 51 | + <rule dir="OUT" name="AMBARIUI/ambari/outbound/appcss"> |
| 52 | + <rewrite template="/gateway/{$frontend[topology]}/ambari/stylesheets/app.css"/> |
| 53 | + </rule> |
| 54 | + <rule dir="OUT" name="AMBARIUI/ambari/outbound/vendorjs"> |
| 55 | + <rewrite template="/gateway/{$frontend[topology]}/ambari/javascripts/vendor.js"/> |
| 56 | + </rule> |
| 57 | + <rule dir="OUT" name="AMBARIUI/ambari/outbound/appjs"> |
| 58 | + <rewrite template="/gateway/{$frontend[topology]}/ambari/javascripts/app.js"/> |
| 59 | + </rule> |
| 60 | + <rule dir="OUT" name="AMBARIUI/ambari/outbound/favicon"> |
| 61 | + <rewrite template="/gateway/{$frontend[topology]}/ambari/img/logo.png"/> |
| 62 | + </rule> |
| 63 | + <rule dir="OUT" name="AMBARIUI/ambari/outbound/notice"> |
| 64 | + <rewrite template="/gateway/{$frontend[topology]}/ambari/licenses/NOTICE.txt"/> |
| 65 | + </rule> |
| 66 | + |
| 67 | + <!-- WS support --> |
| 68 | + <rule dir="OUT" name="AMBARIUI/ambari/outbound/websocket"> |
| 69 | + <rewrite template="/gateway/{$frontend[topology]}/ambariws/api/stomp/v1"/> |
| 70 | + </rule> |
| 71 | + |
| 72 | + <filter name="AMBARIUI/ambari/outbound/proxyroot"> |
| 73 | + <content type="*/x-javascript"> |
| 74 | + <apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/> |
| 75 | + </content> |
| 76 | + <content type="application/javascript"> |
| 77 | + <apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/> |
| 78 | + </content> |
| 79 | + <content type="text/javascript"> |
| 80 | + <apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/> |
| 81 | + </content> |
| 82 | + </filter> |
| 83 | + |
| 84 | + <!-- filter to rewrite api prefix defined in .js from root --> |
| 85 | + <!-- e.g. /api/v1 --> |
| 86 | + <filter name="AMBARIUI/ambari/outbound/apiendpoint"> |
| 87 | + <content type="*/x-javascript"> |
| 88 | + <apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> |
| 89 | + </content> |
| 90 | + <content type="application/javascript"> |
| 91 | + <apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> |
| 92 | + </content> |
| 93 | + <content type="text/javascript"> |
| 94 | + <apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> |
| 95 | + </content> |
| 96 | + </filter> |
| 97 | + |
| 98 | + <filter name="AMBARIUI/ambari/outbound/apiendpoint/html"> |
| 99 | + <content type="text/html"> |
| 100 | + <apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> |
| 101 | + </content> |
| 102 | + </filter> |
| 103 | + |
| 104 | + <filter name="AMBARIUI/ambari/outbound/apiendpoint/noroot"> |
| 105 | + <content type="*/x-javascript"> |
| 106 | + <apply path="api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> |
| 107 | + </content> |
| 108 | + <content type="application/javascript"> |
| 109 | + <apply path="api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> |
| 110 | + </content> |
| 111 | + <content type="text/javascript"> |
| 112 | + <apply path="api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> |
| 113 | + </content> |
| 114 | + </filter> |
| 115 | + |
| 116 | + <filter name="AMBARIUI/ambari/outbound/links"> |
| 117 | + <content type="*/x-javascript"> |
| 118 | + <apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> |
| 119 | + <apply path="/img/" rule="AMBARIUI/ambari/outbound/img"/> |
| 120 | + <apply path="/img/ambari-logo.png" rule="AMBARIUI/ambari/outbound/ambarilogo"/> |
| 121 | + <apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/> |
| 122 | + <apply path="/#/main/dashboard" rule="AMBARIUI/ambari/outbound/logohref"/> |
| 123 | + <!-- WS support --> |
| 124 | + <apply path="/api/stomp/v1" rule="AMBARIUI/ambari/outbound/websocket"/> |
| 125 | + </content> |
| 126 | + <content type="application/javascript"> |
| 127 | + <apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> |
| 128 | + <apply path="/img/" rule="AMBARIUI/ambari/outbound/img"/> |
| 129 | + <apply path="/img/ambari-logo.png" rule="AMBARIUI/ambari/outbound/ambarilogo"/> |
| 130 | + <apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/> |
| 131 | + <apply path="/#/main/dashboard" rule="AMBARIUI/ambari/outbound/logohref"/> |
| 132 | + <!-- WS support --> |
| 133 | + <apply path="/api/stomp/v1" rule="AMBARIUI/ambari/outbound/websocket"/> |
| 134 | + </content> |
| 135 | + <content type="text/javascript"> |
| 136 | + <apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> |
| 137 | + <apply path="/img/" rule="AMBARIUI/ambari/outbound/img"/> |
| 138 | + <apply path="/img/ambari-logo.png" rule="AMBARIUI/ambari/outbound/ambarilogo"/> |
| 139 | + <apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/> |
| 140 | + <apply path="/#/main/dashboard" rule="AMBARIUI/ambari/outbound/logohref"/> |
| 141 | + <!-- WS support --> |
| 142 | + <apply path="/api/stomp/v1" rule="AMBARIUI/ambari/outbound/websocket"/> |
| 143 | + </content> |
| 144 | + <content type="*/html"> |
| 145 | + </content> |
| 146 | + </filter> |
| 147 | + <filter name="AMBARIUI/ambari/outbound/mainpage"> |
| 148 | + <content type="*/html"> |
| 149 | + <apply path="stylesheets/vendor.css" rule="AMBARIUI/ambari/outbound/vendorcss" /> |
| 150 | + <apply path="stylesheets/app.css" rule="AMBARIUI/ambari/outbound/appcss" /> |
| 151 | + <apply path="javascripts/vendor.js" rule="AMBARIUI/ambari/outbound/vendorjs" /> |
| 152 | + <apply path="javascripts/app.js" rule="AMBARIUI/ambari/outbound/appjs" /> |
| 153 | + <apply path="/img/logo.png" rule="AMBARIUI/ambari/outbound/favicon"/> |
| 154 | + <apply path="/img/ambari-logo.png" rule="AMBARIUI/ambari/outbound/ambarilogo"/> |
| 155 | + <apply path="/licenses/NOTICE.txt" rule="AMBARIUI/ambari/outbound/notice"/> |
| 156 | + </content> |
| 157 | + </filter> |
| 158 | +</rules> |
0 commit comments