Welcome! Log In Create A New Profile


Announcement : NGX_HTTP_SET_VAR_MODULE - for developers

Marcus Clyne
December 19, 2009 09:44AM


As inspired by the previous comments about setting hash values to
variables, here's a small module that does just that.

Currently you can generate the MD5, SHA1 and Murmurhash2 values (in
uppercase hexadecimal) of a string, which can include variables.

There are three directives, which can be used anywhere in the http

usage :

location /hash {
set_md5 $md5_val $hash_string;
set_sha1 $sha1_val "some long string with a variable $var";
set_mm2 $murmurhash2_val "a static string hash";

download :


to do :

- documentation online (soon)
- other hashes (let me know if you have any specific ones you want added)
- url escaping

feedback :

If you have any comments (good/bad), or would like some specific
features, let me know.


Anyone developing a module that includes setting values to variables
might have use for this module.

It has been given an interface that makes it much easier to add your own
'variable value filter', without needing to worry about dealing with
http_script's and complex values.

Currently it requires compiling Nginx with OpenSSL (because the hashing
currently requires the functions provided by OpenSSL), but soon it will
be usable without compiling it.

Instructions on how to use the interface with your own module is
provided in the notes.

Hope it's of use to some people.



nginx-devel mailing list
Subject Author Views Posted

Announcement : NGX_HTTP_SET_VAR_MODULE - for developers

Marcus Clyne 3757 December 19, 2009 09:44AM

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

Online Users

Guests: 138
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