<!-- review: finished -->

<a id="external-subs"></a>

# Subs

Модуль Subs позволяет заменять строки в теле HTTP-ответа (как фиксированные, так
и по регулярным выражениям). При этом заменяются все вхождения, найденные в теле
ответа.

<a id="installation-26"></a>

## Установка

Для [установки](https://angie.software//angie/docs/installation/index.md#install-packages) модуля используйте один из следующих пакетов:

- Angie: `angie-module-subs`;
- Angie PRO: `angie-pro-module-subs`.

<a id="loading-the-module-26"></a>

## Загрузка модуля

Подключение модуля в контексте `main{}`:

```nginx
load_module modules/ngx_http_subs_filter_module.so;
```

<a id="configuration-example-101"></a>

## Пример конфигурации

```nginx
http {
    server {
        listen 80;

        location / {
            subs_filter_types text/html text/css text/xml;
            subs_filter st(\d*).example.com $1.example.com ir;
            subs_filter a.example.com s.example.com;
            subs_filter http://$host https://$host;
        }
    }
}
```

<a id="additional-information-27"></a>

## Дополнительная информация

Подробная документация и исходный код доступны по ссылке:
[https://github.com/yaoweibin/ngx_http_substitutions_filter_module](https://github.com/yaoweibin/ngx_http_substitutions_filter_module)
