Skip to content

Commit

Permalink
docs updated
Browse files Browse the repository at this point in the history
  • Loading branch information
lyokha committed Feb 18, 2024
1 parent 18a64de commit 609e693
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
6 changes: 4 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
### 1.2.8

- Module *NgxExport.Tools.Subrequest*: allow setting custom HTTP managers in
subrequest configurations.
- Module *NgxExport.Tools.Subrequest*.
+ Allow setting custom HTTP managers in subrequest configurations.
+ In subrequest configurations, field *useUDS* / *srUseUDS* is no longer
accepted, use *"manager": "uds"* / *srManager = UDS* instead.

### 1.2.7

Expand Down
20 changes: 13 additions & 7 deletions NgxExport/Tools/Subrequest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ ngxExportSimpleServiceTyped 'configureUDS ''UDSConf SingleShotService
-- $subrequestsWithCustomManager
--
-- To serve subrequests, a custom HTTP manager can be implemented and then
-- configured in a custom service handler with 'registerCustomManager'. To
-- enable this manager in the subrequest configuration, use field /manager/
-- registered in a custom service handler with 'registerCustomManager'. To
-- enable this manager in a subrequest configuration, use field /manager/
-- with the key that was bound to the manager in 'registerCustomManager'.
--
-- For example, let's implement a custom UDS manager which will serve
Expand Down Expand Up @@ -564,7 +564,7 @@ ngxExportSimpleServiceTyped 'configureUDS ''UDSConf SingleShotService
-- \'\/tmp\/myuds.sock\';
-- @
--
-- ==== File /nginx.conf/: location /\/uds/ with the custom manager /myuds/
-- ==== File /nginx.conf/: location /\/uds/ with custom manager /myuds/
-- @
-- location \/uds {
-- haskell_run_async __/makeSubrequest/__ $hs_subrequest
Expand All @@ -583,11 +583,17 @@ ngxExportSimpleServiceTyped 'configureUDS ''UDSConf SingleShotService
-- }
-- @

-- | Register a custom HTTP manager with a given key.
-- | Registers a custom HTTP manager with a given key.
--
-- Registered managers can be referred by the key from subrequest
-- configurations in field /manager/ (in JSON-encoded configurations) or
-- /srManager = Custom \"key\"/ (in /read/-encoded configurations).
-- The right place to register a custom manager is a custom service handler that
-- runs just after the start of an Nginx worker process. Registered managers can
-- then be referred to from subrequest configurations by the key in field
-- /manager/ (in JSON-encoded configurations) or as /srManager = Custom \"key\"/
-- (in /read/-encoded configurations).
--
-- Below is an example of a JSON-encoded subrequest configuration.
--
-- > {"uri": "http://example.com/", "manager": "mymanager"}
--
-- Note that keys /default/ and /uds/ have special meaning in field /manager/:
-- they denote internal HTTP and UDS managers respectively.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2048,8 +2048,8 @@ In backend, Custom-Header is 'Value'
---

To serve subrequests, a custom HTTP manager can be implemented and then
configured in a custom service handler with *registerCustomManager*. To
enable this manager in the subrequest configuration, use field *manager*
registered in a custom service handler with *registerCustomManager*. To
enable this manager in a subrequest configuration, use field *manager*
with the key that was bound to the manager in *registerCustomManager*.

For example, let's implement a custom UDS manager which will serve
Expand Down Expand Up @@ -2093,7 +2093,7 @@ ngxExportSimpleService 'configureUdsManager SingleShotService
'/tmp/myuds.sock';
```

###### File *nginx.conf*: location */uds* with the custom manager *myuds*
###### File *nginx.conf*: location */uds* with custom manager *myuds*

```nginx
location /uds {
Expand Down

0 comments on commit 609e693

Please sign in to comment.