Support for 'include' directive in http templating (#160)
* Added 'include' directive in http templating * Added 'include' directive in stream templating
This commit is contained in:
parent
1724fecdd8
commit
42f776f7d8
@ -360,6 +360,7 @@ nginx_http_template:
|
|||||||
conf_file_location: /etc/nginx/conf.d/
|
conf_file_location: /etc/nginx/conf.d/
|
||||||
port: 8081
|
port: 8081
|
||||||
server_name: localhost
|
server_name: localhost
|
||||||
|
include_files: []
|
||||||
error_page: /usr/share/nginx/html
|
error_page: /usr/share/nginx/html
|
||||||
root: /usr/share/nginx/html
|
root: /usr/share/nginx/html
|
||||||
https_redirect: false
|
https_redirect: false
|
||||||
@ -399,6 +400,7 @@ nginx_http_template:
|
|||||||
locations:
|
locations:
|
||||||
default:
|
default:
|
||||||
location: /
|
location: /
|
||||||
|
include_files: []
|
||||||
proxy_hide_headers: [] # A list of headers which shouldn't be passed to the application
|
proxy_hide_headers: [] # A list of headers which shouldn't be passed to the application
|
||||||
add_headers:
|
add_headers:
|
||||||
strict_transport_security:
|
strict_transport_security:
|
||||||
@ -448,6 +450,7 @@ nginx_http_template:
|
|||||||
locations:
|
locations:
|
||||||
backend:
|
backend:
|
||||||
location: /
|
location: /
|
||||||
|
include_files: []
|
||||||
proxy_hide_headers: [] # A list of headers which shouldn't be passed to the application
|
proxy_hide_headers: [] # A list of headers which shouldn't be passed to the application
|
||||||
add_headers:
|
add_headers:
|
||||||
strict_transport_security:
|
strict_transport_security:
|
||||||
@ -578,6 +581,7 @@ nginx_stream_template:
|
|||||||
listen_address: localhost
|
listen_address: localhost
|
||||||
listen_port: 80
|
listen_port: 80
|
||||||
udp_enable: false
|
udp_enable: false
|
||||||
|
include_files: []
|
||||||
proxy_pass: backend
|
proxy_pass: backend
|
||||||
proxy_timeout: 3s
|
proxy_timeout: 3s
|
||||||
proxy_connect_timeout: 1s
|
proxy_connect_timeout: 1s
|
||||||
|
@ -172,6 +172,7 @@ nginx_http_template:
|
|||||||
conf_file_location: /etc/nginx/conf.d/
|
conf_file_location: /etc/nginx/conf.d/
|
||||||
port: 8081
|
port: 8081
|
||||||
server_name: localhost
|
server_name: localhost
|
||||||
|
include_files: []
|
||||||
error_page: /usr/share/nginx/html
|
error_page: /usr/share/nginx/html
|
||||||
root: /usr/share/nginx/html
|
root: /usr/share/nginx/html
|
||||||
https_redirect: false
|
https_redirect: false
|
||||||
@ -211,6 +212,7 @@ nginx_http_template:
|
|||||||
locations:
|
locations:
|
||||||
default:
|
default:
|
||||||
location: /
|
location: /
|
||||||
|
include_files: []
|
||||||
proxy_hide_headers: [] # A list of headers which shouldn't be passed to the application
|
proxy_hide_headers: [] # A list of headers which shouldn't be passed to the application
|
||||||
add_headers:
|
add_headers:
|
||||||
strict_transport_security:
|
strict_transport_security:
|
||||||
@ -260,6 +262,7 @@ nginx_http_template:
|
|||||||
locations:
|
locations:
|
||||||
backend:
|
backend:
|
||||||
location: /
|
location: /
|
||||||
|
include_files: []
|
||||||
proxy_hide_headers: [] # A list of headers which shouldn't be passed to the application
|
proxy_hide_headers: [] # A list of headers which shouldn't be passed to the application
|
||||||
add_headers:
|
add_headers:
|
||||||
strict_transport_security:
|
strict_transport_security:
|
||||||
@ -390,6 +393,7 @@ nginx_stream_template:
|
|||||||
listen_address: localhost
|
listen_address: localhost
|
||||||
listen_port: 80
|
listen_port: 80
|
||||||
udp_enable: false
|
udp_enable: false
|
||||||
|
include_files: []
|
||||||
proxy_pass: backend
|
proxy_pass: backend
|
||||||
proxy_timeout: 3s
|
proxy_timeout: 3s
|
||||||
proxy_connect_timeout: 1s
|
proxy_connect_timeout: 1s
|
||||||
|
@ -91,6 +91,11 @@ server {
|
|||||||
listen {{ item.value.port }};
|
listen {{ item.value.port }};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
server_name {{ item.value.server_name | default('localhost') }};
|
server_name {{ item.value.server_name | default('localhost') }};
|
||||||
|
{% if item.value.include_files is defined and item.value.include_files | length %}
|
||||||
|
{% for file in item.value.include_files %}
|
||||||
|
include "{{ file }}";
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% if item.value.proxy_hide_headers is defined %}
|
{% if item.value.proxy_hide_headers is defined %}
|
||||||
{% for header in item.value.proxy_hide_headers %}
|
{% for header in item.value.proxy_hide_headers %}
|
||||||
proxy_hide_header {{ header }};
|
proxy_hide_header {{ header }};
|
||||||
@ -135,6 +140,11 @@ server {
|
|||||||
{% if item.value.reverse_proxy.locations[location].internal is sameas true %}
|
{% if item.value.reverse_proxy.locations[location].internal is sameas true %}
|
||||||
internal;
|
internal;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if item.value.reverse_proxy.locations[location].include_files is defined and item.value.reverse_proxy.locations[location].include_files | length %}
|
||||||
|
{% for file in item.value.reverse_proxy.locations[location].include_files %}
|
||||||
|
include "{{ file }}";
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% if item.value.reverse_proxy.locations[location].proxy_hide_headers is defined %}
|
{% if item.value.reverse_proxy.locations[location].proxy_hide_headers is defined %}
|
||||||
{% for header in item.value.reverse_proxy.locations[location].proxy_hide_headers %}
|
{% for header in item.value.reverse_proxy.locations[location].proxy_hide_headers %}
|
||||||
proxy_hide_header {{ header }};
|
proxy_hide_header {{ header }};
|
||||||
@ -289,6 +299,11 @@ server {
|
|||||||
{% if item.value.web_server.locations[location].try_files is defined %}
|
{% if item.value.web_server.locations[location].try_files is defined %}
|
||||||
try_files {{ item.value.web_server.locations[location].try_files }};
|
try_files {{ item.value.web_server.locations[location].try_files }};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if item.value.web_server.locations[location].include_files is defined and item.value.web_server.locations[location].include_files | length %}
|
||||||
|
{% for file in item.value.web_server.locations[location].include_files %}
|
||||||
|
include "{{ file }}";
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% if item.value.web_server.locations[location].proxy_hide_headers is defined %}
|
{% if item.value.web_server.locations[location].proxy_hide_headers is defined %}
|
||||||
{% for header in item.value.web_server.locations[location].proxy_hide_headers %}
|
{% for header in item.value.web_server.locations[location].proxy_hide_headers %}
|
||||||
proxy_hide_header {{ header }};
|
proxy_hide_header {{ header }};
|
||||||
|
@ -42,6 +42,11 @@ server {
|
|||||||
{% else %}
|
{% else %}
|
||||||
listen {{ item.value.network_streams[stream].listen_port }};
|
listen {{ item.value.network_streams[stream].listen_port }};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% if item.value.network_streams[stream].include_files is defined and item.value.network_streams[stream].include_files | length %}
|
||||||
|
{% for file in item.value.network_streams[stream].include_files %}
|
||||||
|
include "{{ file }}";
|
||||||
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
proxy_pass {{ item.value.network_streams[stream].proxy_pass }};
|
proxy_pass {{ item.value.network_streams[stream].proxy_pass }};
|
||||||
proxy_timeout {{ item.value.network_streams[stream].proxy_timeout }};
|
proxy_timeout {{ item.value.network_streams[stream].proxy_timeout }};
|
||||||
|
Loading…
Reference in New Issue
Block a user