add stor1/stor2/virt, and support load balancing directly from these nodes
This commit is contained in:
parent
a2c35813b7
commit
2028fd6c7d
@ -2,8 +2,13 @@
|
||||
proxy_package_list : ['nginx','git']
|
||||
proxy_site_conf_dir : /etc/nginx/conf.d
|
||||
proxy_site_file : "{{ proxy_site_conf_dir }}/zen_proxy.conf"
|
||||
proxy_site_version : 1.9
|
||||
proxy_site_revision : 22317-1
|
||||
proxy_site_version : 1.93
|
||||
proxy_site_revision : 23620-2
|
||||
|
||||
|
||||
# undefined default: round robin
|
||||
# options: least_conn|ip_hash
|
||||
proxy_load_balance_type: ip_hash
|
||||
|
||||
|
||||
proxy_site_log_path : /proxy_logs
|
||||
|
@ -196,6 +196,28 @@ proxy_sites:
|
||||
port : 9443
|
||||
|
||||
|
||||
stor1.thezengarden.net:
|
||||
proto : http
|
||||
dest : zg-stor1.thezengarden.net
|
||||
port : 80
|
||||
|
||||
|
||||
stor2.thezengarden.net:
|
||||
proto : http
|
||||
dest : zg-stor2.thezengarden.net
|
||||
port : 80
|
||||
|
||||
|
||||
virt.thezengarden.net:
|
||||
proto: https
|
||||
dest: proxmox_nodes
|
||||
upstream_servers:
|
||||
- zg-vm1.thezengarden.net:8006
|
||||
- zg-vm2.thezengarden.net:8006
|
||||
- zg-vm3.thezengarden.net:8006
|
||||
- zg-vm4.thezengarden.net:8006
|
||||
|
||||
|
||||
beta.chris-hammer.com:
|
||||
proto : http
|
||||
dest : "{{ proxy_default_host }}"
|
||||
|
@ -20,6 +20,18 @@ map $remote_addr $log_ip {
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if proxy_sites[item.key]['upstream_servers'] is defined %}
|
||||
upstream {{ proxy_sites[item.key]['dest'] }} {
|
||||
{% if proxy_load_balance_type is defined %}
|
||||
{{ proxy_load_balance_type }};
|
||||
{% endif %}
|
||||
{% for upstream in proxy_sites[item.key]['upstream_servers'] %}
|
||||
server {{ upstream }};
|
||||
{% endfor %}
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name {{ item.key }} {% if proxy_sites[item.key]['aliases'] is defined %}{{ proxy_sites[item.key]['aliases'] }}{% endif %};
|
||||
@ -58,7 +70,11 @@ location /nginx_status {
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
{% if proxy_sites[item.key]['port'] is defined %}
|
||||
proxy_pass {{ proxy_sites[item.key]['proto'] }}://{{ proxy_sites[item.key]['dest'] }}:{{ proxy_sites[item.key]['port'] }};
|
||||
{% else %}
|
||||
proxy_pass {{ proxy_sites[item.key]['proto'] }}://{{ proxy_sites[item.key]['dest'] }};
|
||||
{% endif %}
|
||||
|
||||
|
||||
# re-write redirects to http as to https
|
||||
|
Loading…
x
Reference in New Issue
Block a user