ngx_stream_map_module missing/not enabled

Asked by Oliver Paukstadt

I have jitsi running on Ubuntu 20.04.1 LTS.

I tried to improve the TURN server setup for portsharing with nginx:

The main part of the nginx configuration is using a map inside the stream context:
stream {
    map $ssl_preread_server_name $name { web_backend; turn_backend;
This always dies with
[emerg] 33685#33685: could not build map_hash, you should increase map_hash_bucket_size: 32

According to
for setting a map inside the stream context this module is required.

I did not check the build prcedure but I think this could be solved by enabling this module during build.
Is this possible, even for 20.04 LTS?

Question information

English Edit question
Ubuntu nginx Edit question
Thomas Ward Edit question
Solved by:
Thomas Ward
Last query:
Last reply:
Revision history for this message
Best Thomas Ward (teward) said :

This is not the lack of a module. The system tells you to increase your map_hash_bucket_size first to 32.

The stream map module is **not** an optional module, in this case. As long as you are using nginx-core, nginx-full, or nginx-extras, you should have the module.

Try setting `map_hash_bucket_size` to a value of 32 or greater **as the error message suggests**.

If the configuration option wasn't available you'd have "Invalid directive" as an error, not the error you're getting. Start by adjusting your config as the system suggests (my guess is you don't have enough size in your hash buckets).

Revision history for this message
Oliver Paukstadt (oliver-paukstadt) said :

The setting must be greater than 32 like 64 or 128. Setting the map_hash_bucket_size within the stream section to 32 only did not make the error disappear.

Revision history for this message
Oliver Paukstadt (oliver-paukstadt) said :

Thanks Thomas Ward, that solved my question.