Added support for try_files (#117)
* Added support for try_files * updated try_files for server and web server * change stream test template port to 81 for travis * Fix for travis test and localhost error
This commit is contained in:
parent
1cf74a5d5e
commit
4c96e196d4
@ -171,6 +171,7 @@ nginx_http_template:
|
|||||||
root: /usr/share/nginx/html
|
root: /usr/share/nginx/html
|
||||||
https_redirect: false
|
https_redirect: false
|
||||||
autoindex: false
|
autoindex: false
|
||||||
|
try_files: $uri $uri/index.html $uri.html =404
|
||||||
ssl:
|
ssl:
|
||||||
cert: /etc/ssl/certs/default.crt
|
cert: /etc/ssl/certs/default.crt
|
||||||
key: /etc/ssl/private/default.key
|
key: /etc/ssl/private/default.key
|
||||||
@ -187,6 +188,7 @@ nginx_http_template:
|
|||||||
autoindex: false
|
autoindex: false
|
||||||
auth_basic: null
|
auth_basic: null
|
||||||
auth_basic_file: null
|
auth_basic_file: null
|
||||||
|
try_files: $uri $uri/index.html $uri.html =404
|
||||||
http_demo_conf: false
|
http_demo_conf: false
|
||||||
reverse_proxy:
|
reverse_proxy:
|
||||||
proxy_cache_path:
|
proxy_cache_path:
|
||||||
@ -238,6 +240,7 @@ nginx_http_template:
|
|||||||
websocket: false
|
websocket: false
|
||||||
auth_basic: null
|
auth_basic: null
|
||||||
auth_basic_file: null
|
auth_basic_file: null
|
||||||
|
try_files: $uri $uri/index.html $uri.html =404
|
||||||
health_check_plus: false
|
health_check_plus: false
|
||||||
proxy_cache:
|
proxy_cache:
|
||||||
proxy_cache_path:
|
proxy_cache_path:
|
||||||
|
@ -77,6 +77,9 @@ server {
|
|||||||
{% if item.value.autoindex is defined and item.value.autoindex %}
|
{% if item.value.autoindex is defined and item.value.autoindex %}
|
||||||
autoindex on;
|
autoindex on;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if item.value.try_files is defined %}
|
||||||
|
try_files {{ item.value.try_files }};
|
||||||
|
{% endif %}
|
||||||
{% if item.value.reverse_proxy is defined %}
|
{% if item.value.reverse_proxy is defined %}
|
||||||
{% for location in item.value.reverse_proxy.locations %}
|
{% for location in item.value.reverse_proxy.locations %}
|
||||||
location {{ item.value.reverse_proxy.locations[location].location }} {
|
location {{ item.value.reverse_proxy.locations[location].location }} {
|
||||||
@ -93,6 +96,9 @@ server {
|
|||||||
{% if item.value.reverse_proxy.locations[location].proxy_read_timeout is defined and item.value.reverse_proxy.locations[location].proxy_read_timeout %}
|
{% if item.value.reverse_proxy.locations[location].proxy_read_timeout is defined and item.value.reverse_proxy.locations[location].proxy_read_timeout %}
|
||||||
proxy_read_timeout {{ item.value.reverse_proxy.locations[location].proxy_read_timeout }};
|
proxy_read_timeout {{ item.value.reverse_proxy.locations[location].proxy_read_timeout }};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if item.value.reverse_proxy.locations[location].try_files is defined %}
|
||||||
|
try_files {{ item.value.reverse_proxy.locations[location].try_files }};
|
||||||
|
{% endif %}
|
||||||
{% if item.value.reverse_proxy.locations[location].proxy_ssl is defined %}
|
{% if item.value.reverse_proxy.locations[location].proxy_ssl is defined %}
|
||||||
|
|
||||||
{% if item.value.reverse_proxy.locations[location].proxy_ssl.cert is defined %}
|
{% if item.value.reverse_proxy.locations[location].proxy_ssl.cert is defined %}
|
||||||
@ -177,6 +183,9 @@ server {
|
|||||||
{% if item.value.web_server.locations[location].autoindex %}
|
{% if item.value.web_server.locations[location].autoindex %}
|
||||||
autoindex on;
|
autoindex on;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if item.value.web_server.locations[location].try_files is defined %}
|
||||||
|
try_files {{ item.value.web_server.locations[location].try_files }};
|
||||||
|
{% endif %}
|
||||||
{% if item.value.web_server.locations[location].auth_basic is defined and item.value.web_server.locations[location].auth_basic %}
|
{% if item.value.web_server.locations[location].auth_basic is defined and item.value.web_server.locations[location].auth_basic %}
|
||||||
auth_basic "{{ item.value.web_server.locations[location].auth_basic }}";
|
auth_basic "{{ item.value.web_server.locations[location].auth_basic }}";
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -22,11 +22,19 @@ upstream {{ item.value.upstreams[upstream].name }} {
|
|||||||
{% for stream in item.value.network_streams %}
|
{% for stream in item.value.network_streams %}
|
||||||
server {
|
server {
|
||||||
{% if item.value.network_streams[stream].listen_address is defined and item.value.network_streams[stream].listen_port is defined %}
|
{% if item.value.network_streams[stream].listen_address is defined and item.value.network_streams[stream].listen_port is defined %}
|
||||||
|
{% if item.value.network_streams[stream].listen_address == 'localhost' %}
|
||||||
|
{% if item.value.network_streams[stream].udp_enable %}
|
||||||
|
listen {{ item.value.network_streams[stream].listen_port }} udp;
|
||||||
|
{% else %}
|
||||||
|
listen {{ item.value.network_streams[stream].listen_port }};
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
{% if item.value.network_streams[stream].udp_enable %}
|
{% if item.value.network_streams[stream].udp_enable %}
|
||||||
listen {{ item.value.network_streams[stream].listen_address }}:{{ item.value.network_streams[stream].listen_port }} udp;
|
listen {{ item.value.network_streams[stream].listen_address }}:{{ item.value.network_streams[stream].listen_port }} udp;
|
||||||
{% else %}
|
{% else %}
|
||||||
listen {{ item.value.network_streams[stream].listen_address }}:{{ item.value.network_streams[stream].listen_port }};
|
listen {{ item.value.network_streams[stream].listen_address }}:{{ item.value.network_streams[stream].listen_port }};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
{% elif item.value.network_streams[stream].listen_port is defined %}
|
{% elif item.value.network_streams[stream].listen_port is defined %}
|
||||||
{% if item.value.network_streams[stream].udp_enable %}
|
{% if item.value.network_streams[stream].udp_enable %}
|
||||||
listen {{ item.value.network_streams[stream].listen_port }} udp;
|
listen {{ item.value.network_streams[stream].listen_port }} udp;
|
||||||
|
Loading…
Reference in New Issue
Block a user