<!-- review: finished -->

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

# Subs

The Subs module allows for the replacement of strings in the body of HTTP responses (both fixed and using regular expressions). All occurrences found in the response body are replaced.

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

## Installation

To [install](https://en.angie.software//angie/docs/installation/index.md#install-packages) the module, use one of the following packages:

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

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

## Loading the Module

To include the module in the context of `main{}`:

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

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

## Configuration Example

```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>

## Additional Information

Detailed documentation and source code are available at:
[https://github.com/yaoweibin/ngx_http_substitutions_filter_module](https://github.com/yaoweibin/ngx_http_substitutions_filter_module)
