File tree Expand file tree Collapse file tree 2 files changed +5
-24
lines changed Expand file tree Collapse file tree 2 files changed +5
-24
lines changed Original file line number Diff line number Diff line change 2
2
nginx_etc : " /etc/nginx"
3
3
nginx_default_root : " /usr/share/nginx/html" # Will only work for ubuntu
4
4
nginx_max_clients : 512
5
- nginx_install_repo : " ubuntu" # Options: ["nginx", "ubuntu"]
5
+ nginx_install_repo : " ubuntu" # Options: ["nginx", "ubuntu"]
6
6
nginx_apt_state : " present" # Options: ["latest", "present"]
7
7
8
8
# Should we control sites enabled
@@ -31,27 +31,11 @@ nginx_site :
31
31
root : " {{ nginx_default_root }}"
32
32
}
33
33
# # Use yaml
34
- location2 :
34
+ location2 :
35
35
name : /doc/
36
36
type : location
37
37
alias : " /usr/share/doc/"
38
- autoindex : " on"
38
+ autoindex : " on"
39
39
allow : " 127.0.0.1"
40
- deny : " all"
40
+ deny : " all"
41
41
42
- fragments :
43
- list :
44
- - path : " ~* ^/fragment1($|/.*$)"
45
- proxy_pass : " some-upstream"
46
- # If upstream not defined uses the target as a service name from consul
47
- server : " upstream_address1"
48
-
49
- - path : " ~* ^/other_fragment($|/.*$)"
50
- proxy_pass : " other-upstream"
51
- server : " upstream_address2"
52
-
53
- common_config :
54
- # list of common nginx config options for all fragments
55
- proxy_set_header :
56
- - " X-Forwarded-Proto https"
57
- - " Proxy ''" # https://httpoxy.org/
Original file line number Diff line number Diff line change 2
2
{% for fragment in fragments ['list' ] %}
3
3
location {{ fragment.path }} {
4
4
proxy_pass http://{{fragment.proxy_pass}};
5
- {% if 'proxy_intercept_errors' in fragment %}
6
- proxy_intercept_errors {{ fragment['proxy_intercept_errors'] }};
7
- {% endif %}
8
5
{% set combined_config = fragments ['common_config' ] %}
9
6
{% set _ = combined_config .update (fragment ) %}
10
7
{% for key , value in combined_config .iteritems () %}
11
- {% if key in ['proxy_pass' , 'path' ] %}
8
+ {% if key in ['proxy_pass' , 'path' , 'server' ] %}
12
9
{% else %}
13
10
{% if value is iterable and value is not string %}
14
11
{% for array_value in value %}
You can’t perform that action at this time.
0 commit comments