Skip to content

Commit 9580721

Browse files
committed
[futurepress#99] Support of the mod_setenv module (sets custom headers on requests/responses)
1 parent e188399 commit 9580721

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ set(PLUGIN_STATIC
121121
PLUGIN_INIT(mod_h2)\n
122122
PLUGIN_INIT(mod_indexfile)\n
123123
PLUGIN_INIT(mod_rewrite)\n
124+
PLUGIN_INIT(mod_setenv)\n
124125
PLUGIN_INIT(mod_staticfile)\n
125126
)
126127

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
[MainBundlePath]: https://www.npmjs.com/package/@dr.pogodin/react-native-fs#mainbundlepath
2121
[mod_alias]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_alias
2222
[mod_rewrite]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_rewrite
23+
[mod_setenv]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_setenv
2324
[mod_webdav]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_webdav
2425
[New Architecture]: https://reactnative.dev/docs/the-new-architecture/landing-page
2526
[Old Architecture]: https://reactnative.dev/docs/native-modules-intro
@@ -64,6 +65,7 @@ and [old][Old Architecture] RN architectures.
6465
- [Bundling-in Server Assets Into an App Statically]
6566
- [Enabling Alias module]
6667
- [Enabling Rewrite module]
68+
- [Enabling SetEnv module]
6769
- [Enabling WebDAV module]
6870
- [Connecting to an Active Server in the Native Layer]
6971
- [API Reference](#api-reference)
@@ -440,6 +442,23 @@ extraConfig: `
440442
// GET "/file"
441443
```
442444
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+
443462
### Enabling WebDAV Module
444463
[Enabling WebDAV module]: #enabling-webdav-module
445464

0 commit comments

Comments
 (0)