|
20 | 20 | [MainBundlePath]: https://www.npmjs.com/package/@dr.pogodin/react-native-fs#mainbundlepath
|
21 | 21 | [mod_alias]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_alias
|
22 | 22 | [mod_rewrite]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_rewrite
|
| 23 | +[mod_setenv]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_setenv |
23 | 24 | [mod_webdav]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_webdav
|
24 | 25 | [New Architecture]: https://reactnative.dev/docs/the-new-architecture/landing-page
|
25 | 26 | [Old Architecture]: https://reactnative.dev/docs/native-modules-intro
|
@@ -64,6 +65,7 @@ and [old][Old Architecture] RN architectures.
|
64 | 65 | - [Bundling-in Server Assets Into an App Statically]
|
65 | 66 | - [Enabling Alias module]
|
66 | 67 | - [Enabling Rewrite module]
|
| 68 | + - [Enabling SetEnv module] |
67 | 69 | - [Enabling WebDAV module]
|
68 | 70 | - [Connecting to an Active Server in the Native Layer]
|
69 | 71 | - [API Reference](#api-reference)
|
@@ -440,6 +442,23 @@ extraConfig: `
|
440 | 442 | // GET "/file"
|
441 | 443 | ```
|
442 | 444 |
|
| 445 | +### Enabling SetEnv Module |
| 446 | +[Enabling SetEnv module]: #enabling-setenv-module |
| 447 | +
|
| 448 | +[Lighttpd]'s built-in module [mod_setenv] allows to modify request and response |
| 449 | +headers. To enable it just use `extraConfig` option of [Server] [constructor()] |
| 450 | +to load and configure it, for example: |
| 451 | +```ts |
| 452 | +extraConfig: ` |
| 453 | + server.modules += ("mod_setenv") |
| 454 | + setenv.add-response-header = ( |
| 455 | + "My-Custom-Header" => "my-custom-value" |
| 456 | + "Another-Custom-Header" => "another-custom-value" |
| 457 | + ) |
| 458 | + setenv.add-request-header = ("X-Proxy" => "my.server.name") |
| 459 | +`, |
| 460 | +``` |
| 461 | +
|
443 | 462 | ### Enabling WebDAV Module
|
444 | 463 | [Enabling WebDAV module]: #enabling-webdav-module
|
445 | 464 |
|
|
0 commit comments