@@ -78,6 +78,30 @@ server {
7878 { % endfor %}
7979 { % endif %}
8080
81+ { % if item.custom_locations is defined -%}
82+ ## Custom location(s)
83+ { % for location in item.custom_locations -%}
84+ location {{ location .operator|default( '=' ) }} "{{ location.path }}" {
85+ { % if location .allowed_ips is defined -%}
86+ { % for allowed_ip in location .allowed_ips %}
87+ allow {{ allowed_ip }} ;
88+ { % endfor %}
89+ deny all;
90+ { % endif %}
91+ { %- if location .denied_ips is defined -%}
92+ { %- for denied_ip in location .denied_ips %}
93+ deny {{ denied_ip }} ;
94+ { % endfor %}
95+ { % endif -%}
96+ { %- if location .fastcgi_pass is defined -%}
97+ include fastcgi_params;
98+ fastcgi_pass {{ location .fastcgi_pass }} ;
99+ { % else %}
100+ try_files $uri @drupal;
101+ { % endif %}
102+ }
103+ { % endfor %}
104+ { % endif %}
81105
82106 { % if not nginx_drupal_use_boost -%}
83107 { % if not nginx_drupal_escape_uri -%}
@@ -267,6 +291,31 @@ server {
267291 { % endfor %}
268292 { % endif %}
269293
294+ { % if item.custom_locations is defined %}
295+ ## Custom location(s)
296+ { % for location in item.custom_locations %}
297+ location {{ location .operator }} "{{ location.path }}" {
298+ { % if location .allowed_ips is defined %}
299+ { % for allowed_ip in location .allowed_ips %}
300+ allow {{ allowed_ip }} ;
301+ { % endfor %}
302+ deny all;
303+ { % endif %}
304+ { % if location .denied_ips is defined %}
305+ { % for denied_ip in location .denied_ips %}
306+ deny {{ denied_ip }} ;
307+ { % endfor %}
308+ { % endif %}
309+ { % if location .fastcgi_pass is defined %}
310+ include fastcgi_params;
311+ fastcgi_pass {{ location .fastcgi_pass }} ;
312+ { % else %}
313+ try_files $uri @drupal;
314+ { % endif %}
315+ }
316+ { % endfor %}
317+ { % endif %}
318+
270319 { % if not nginx_drupal_use_boost -%}
271320 { % if not nginx_drupal_escape_uri -%}
272321 ################################################################
0 commit comments