Welcome! Log In Create A New Profile

Advanced

Re: Help developing a block directive

Joseph Spencer
June 28, 2017 05:16PM
Hello,

I'm trying to support this in my nginx.conf:

my_custom_module_block {
directive_for_my_custom_module_block "Some value";
}

Here is how I'm setting up the commands:

static ngx_command_t ngx_my_custom_module_commands[] = {

{

ngx_string("my_custom_module_block"), /* directive */

NGX_HTTP_SRV_CONF |

NGX_HTTP_LOC_CONF |

NGX_CONF_NOARGS |

NGX_CONF_BLOCK,

my_custom_module_block, /* configuration setup function */

0, /* No offset. Only one context is supported. */

0, /* No offset when storing the module configuration on struct. */

NULL

},



{

ngx_string("directive_for_my_custom_module_block"), /* directive */

NGX_CONF_TAKE1,

ngx_directive_for_my_custom_module_block_cmd, /* configuration
setup function */
0, /* No offset. Only one context is supported. */

0, /* No offset when storing the module configuration on struct. */

NULL

},



ngx_null_command /* command termination */

};

Everything compiles fine; however, I receive the following error and nginx
won't start:

2017/06/28 21:02:44 [emerg] 1#1: "directive_for_my_custom_module_block"
directive is not allowed here in /etc/nginx/nginx.conf:19
nginx: [emerg] "directive_for_my_custom_module_block" directive is not
allowed here in /etc/nginx/nginx.conf:19

If anyone could be of assistance I would greatly appreciate it.

--
Thanks,
Joe Spencer (member)
Kogo Software LLC
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Re: Help developing a block directive

Joseph Spencer 603 June 28, 2017 05:16PM

Re: Help developing a block directive

Vladimir Homutov 398 June 28, 2017 05:40PM

Re: Help developing a block directive

Joseph Spencer 406 June 28, 2017 06:02PM

RE: Help developing a block directive

erankor 964 June 29, 2017 02:04AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 189
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready