Skip to content

Commit 94314db

Browse files
committed
ngx-live: store_s3_put_add_header directive
add the ability to set custom headers in S3 PUT requests.
1 parent 2a78f61 commit 94314db

5 files changed

Lines changed: 681 additions & 268 deletions

File tree

‎nginx-live-module/README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,6 +1620,14 @@ Defines the parameters of an S3 bucket used for persistence.
16201620
Enables persistence using the specified S3 bucket.
16211621
The name parameter must match the name of a previously defined `store_s3_block` block.
16221622

1623+
#### store_s3_put_add_header
1624+
* **syntax**: `store_s3_put_add_header name value;`
1625+
* **default**: ``
1626+
* **context**: `live`, `preset`
1627+
1628+
Adds an HTTP header to PUT requests sent to S3.
1629+
The header value can contain variables.
1630+
16231631
#### url
16241632
* **syntax**: `url str;`
16251633
* **default**: ``

‎nginx-live-module/src/ngx_live_script.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
#include "ngx_live.h"
1515

1616

17+
#define ngx_live_null_complex_value \
18+
{ ngx_null_string, 0, NULL, NULL, { 0 } }
19+
#define ngx_live_static_complex_value(v) \
20+
{ ngx_string(v), 0, NULL, NULL, { 0 } }
21+
22+
1723
typedef struct {
1824
u_char *ip;
1925
u_char *pos;

‎nginx-live-module/src/persist/ngx_live_persist.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ ngx_live_persist_write_file(ngx_live_channel_t *channel,
291291

292292
request.pool = pool;
293293
request.channel = channel;
294+
request.vctx = vctx;
294295
request.size = size;
295296
request.handler = handler;
296297
request.data = ctx;

‎nginx-live-module/src/persist/ngx_live_store.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ typedef void (*ngx_live_store_write_handler_pt)(void *data, ngx_int_t rc);
6060
typedef struct {
6161
ngx_pool_t *pool;
6262
ngx_live_channel_t *channel;
63+
ngx_live_variables_ctx_t *vctx;
6364
ngx_str_t path;
6465
ngx_chain_t *cl;
6566
size_t size;

0 commit comments

Comments
 (0)