Better Reverse Proxies with SWAG and Ansible
1 min read

Better Reverse Proxies with SWAG and Ansible

I've updated my swag_reverse_proxy role with more variables for templates!
Better Reverse Proxies with SWAG and Ansible

Today I've updated my swag_reverse_proxy role to provide more variables to templates. The new list of variables is:

site_protocol: "{{ item.src.protocol }}"
site_host: "{%if hostvars[item.src.host].ansible_host is defined %}{{ hostvars[item.src.host].ansible_host }}{% else %}{{item.src.host}}{% endif %}"
site_port: "{{ item.src.port }}"
site_internal_url: "{{ item.src.protocol }}://{%if hostvars[item.src.host].ansible_host is defined %}{{ hostvars[item.src.host].ansible_host }}{% else %}{{item.src.host}}{% endif %}:{{ item.src.port }}"
template_name: "{{ item.template_name }}"
site_name: "{{ item.alias }}.{{ item.domain }}"
domain: "{{ item.domain }}"

It allows you the possibility to specify the internal site's protocol, ip address and port. This means more flexibility!

HTH,