Using map for upstream configuration on NGINX

Hi everyone, sorry for not posting any content here for such a long time.

Some of you should have noticed already that I like using map for a lot of stuff. Another neat usage of map is to simplify your configuration, let me give you a quick example.

Imagine that you have the following configuration:

To simplify your configuration, you can use map with the following configuration:

This helps to reduce the mess on the configuration made by a lot of location { … } blocks with similar configurations.