diff --git a/defaults/main.yml b/defaults/main.yml index 7e2fc8b..7d24027 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -117,6 +117,12 @@ nginx_vhosts_default: # dhparam: # client_max_body_size: # send_timeout: +# maps: +# - input: $input +# output: $output +# parameters: +# - "default 0" +# - "/old/path /new_path" # locations: # - match: / # root: /var/www/vhosts/default diff --git a/templates/etc/nginx/sites-available/vhost.j2 b/templates/etc/nginx/sites-available/vhost.j2 index 2983be8..842ad34 100644 --- a/templates/etc/nginx/sites-available/vhost.j2 +++ b/templates/etc/nginx/sites-available/vhost.j2 @@ -37,7 +37,17 @@ server { {% if server.send_timeout is defined and server.send_timeout %} send_timeout {{ server.send_timeout }}; {% endif %} + {% if server.maps is defined and server.maps %} + {% for map in server.maps %} + map {{ map.input }} {{ map.output }} { + {% for param in map.parameters %} + {{ param }}; + {% endfor %} + } + {% endfor %} + + {% endif %} {% for location in server.locations %} location {{ location.match }} { {% if location.root is defined and location.root %}