Forum: NGINX Variables in FreeBSD

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 dalspenguin (Guest)
on 2009-04-26 16:46
(Received via mailing list)
Hello,

I have created nginx module (compile by gcc) and found that nginx does
not support VARIABLES on the FreeBSD os.
I try to use it like
ngx_str_t name = {r->variables[1].len, (unsigned char *)
r->variables[1].data};
However every time I get errors in the error.log file: signal 11
It's works perfect on the Ubuntu os. I've read VARIABLES are not
supported for the nginx 0.7.52. But I need to get the value of variables
when I call my module from nginx.conf like
set_module_value $returnedValue $incomingValue
Could anyone help me to get a value from the variable $incomingValue on
FreeBSD OS?
Is there any way to get variable value on FreeBSD OS?

Thanks a lot!

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,1447,1447#msg-1447
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2009-04-26 23:21
(Received via mailing list)
Hello!

On Sun, Apr 26, 2009 at 10:34:17AM -0400, dalspenguin wrote:

> Hello,
>
> I have created nginx module (compile by gcc) and found that nginx does not support 
VARIABLES on the FreeBSD os.
> I try to use it like
> ngx_str_t name = {r->variables[1].len, (unsigned char *) r->variables[1].data};
> However every time I get errors in the error.log file: signal 11
> It's works perfect on the Ubuntu os. I've read VARIABLES are not supported for the nginx 
0.7.52. But I need to get the value of variables when I call my module from nginx.conf 
like
> set_module_value $returnedValue $incomingValue
> Could anyone help me to get a value from the variable $incomingValue on FreeBSD OS?
> Is there any way to get variable value on FreeBSD OS?

It's not really OS related.  It's just the fact that your
broken code happend to work under Ubuntu for some reason.

You shouldn't even try to access r->variables by hand.  Use
ngx_http_variables.[ch] functions instead.

If you know variable name at configuration stage, you should
probably use ngx_http_get_variable_index() during parsing config
and store returned index, and then use
ngx_http_get_indexed_variable() during request processing.

Multiple examples of variable usage may be found in various
official nginx modules, read source for details.

Maxim Dounin
2974d09ac2541e892966b762aad84943?d=identicon&s=25 dalspenguin (Guest)
on 2009-04-28 00:53
(Received via mailing list)
Hello,

Thanks a lot.

It's just working!!!

Yours sincerely,
Alex

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,1447,1454#msg-1454
This topic is locked and can not be replied to.