Исходный код вики Проблемы и сценарии
Редактировал(а) Alexandr Fokin 2023/01/28 20:46
Скрыть последних авторов
author | version | line-number | content |
---|---|---|---|
![]() |
1.14 | 1 | |(% style="width:262px" %)Отключения настройки |
2 | "Reverse rewrite host in response headers"|(% style="width:1231px" %)((( | ||
![]() |
1.2 | 3 | Возможны случаи, когда веб приложение будет формировать html страницы, содержащие некорректные ссылки. Например ссылающиеся не на адрес прокси, а на внутренний адрес приложения. |
4 | Потребуется, что прокси модифицировал исходящие страницы, переписывая содержимое на основе некоторых правил. | ||
5 | |||
![]() |
1.4 | 6 | IIS reverse proxy with rewrites can't handle a redirect from the server we proxy to |
7 | https://stackoverflow.com/questions/4243959/iis-reverse-proxy-with-rewrites-cant-handle-a-redirect-from-the-server-we-proxy | ||
![]() |
1.14 | 8 | ))) |
9 | |(% style="width:262px" %)Переписывание заголовков во входящих запросах для отключения сжатия в ответах сервера приложения. | ||
10 | (Например gzip)|(% style="width:1231px" %)((( | ||
![]() |
1.3 | 11 | У IIS могут возникнуть проблем с изменением содержимого страницы, если ответ от сервера приложения возвращается в сжатом виде. |
12 | |||
![]() |
1.6 | 13 | IIS as a reverse proxy - compression of rewritten response from backend server |
14 | https://stackoverflow.com/questions/15926203/iis-as-a-reverse-proxy-compression-of-rewritten-response-from-backend-server | ||
![]() |
1.3 | 15 | |
![]() |
1.6 | 16 | The server variable is not allowed to be set. |
17 | http://www.sansys.net/2015/01/server-variable-is-not-allowed-to-be-set.html | ||
18 | |||
![]() |
1.8 | 19 | Замечание: заголовок с указанием сжатия для html контента, и для ответа от web api могут быть разными. |
![]() |
1.14 | 20 | ))) |
21 | |(% style="width:262px" %)Переписывание редирект ссылок в хедерах ответов от севера приложения|(% style="width:1231px" %)Modifying HTTP Response Headers | ||
![]() |
1.7 | 22 | https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/modifying-http-response-headers |
![]() |
1.14 | 23 | |(% style="width:262px" %)Переписывание ссылок в html страницах, json ответах web api и другом контенте.|(% style="width:1231px" %)((( |
![]() |
1.9 | 24 | How to fix URL Rewriting for links inside CSS files with IIS7 |
25 | https://stackoverflow.com/questions/8653399/how-to-fix-url-rewriting-for-links-inside-css-files-with-iis7 | ||
26 | |||
![]() |
1.8 | 27 | Замечание: паттерн сопоставления в html страницах и json документах могут различаться в следствии наличия/отсутствия/различии в экранировании символов. |
![]() |
1.11 | 28 | |
29 | {{code language="xml"}} | ||
30 | <outboundRules> | ||
31 | <preConditions> | ||
32 | <preCondition name="IsRedirection"> | ||
![]() |
1.14 | 33 | <add input="{RESPONSE_STATUS}" pattern="3\d\d" ></add> |
![]() |
1.11 | 34 | </preCondition> |
35 | <preCondition name="ResponseIsHtml"> | ||
![]() |
1.14 | 36 | <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" ></add> |
![]() |
1.11 | 37 | </preCondition> |
38 | <preCondition name="ResponseIsJson"> | ||
![]() |
1.14 | 39 | <add input="{RESPONSE_CONTENT_TYPE}" pattern="^application/json" ></add> |
![]() |
1.11 | 40 | </preCondition> |
41 | </preConditions> | ||
42 | <rule name="Rewrite Location Header" preCondition="IsRedirection" stopProcessing="true"> | ||
![]() |
1.14 | 43 | <match serverVariable="RESPONSE_Location" pattern="http://ResponseUrl(.*)" ></match> |
44 | <action type="Rewrite" value="https://ProxyUrl{R:1}" ></action> | ||
![]() |
1.11 | 45 | </rule> |
46 | <rule name="Rewrite static content" preCondition="ResponseIsHtml" stopProcessing="true"> | ||
![]() |
1.14 | 47 | <match filterByTags="None" pattern="http://ResponseUrl" ></match> |
48 | <action type="Rewrite" value="https://ProxyUrl" ></action> | ||
![]() |
1.11 | 49 | </rule> |
50 | <rule name="Rewrite api content" preCondition="ResponseIsJson" stopProcessing="true"> | ||
![]() |
1.14 | 51 | <match filterByTags="None" pattern="http:\\/\\/ResponseUrl" ></match> |
52 | <action type="Rewrite" value="https://ProxyUrl" ></action> | ||
![]() |
1.11 | 53 | </rule> |
54 | </outboundRules> | ||
55 | {{/code}} | ||
![]() |
1.14 | 56 | ))) |
57 | |(% style="width:262px" %) |(% style="width:1231px" %) | ||
58 | |(% style="width:262px" %) |(% style="width:1231px" %) |