diff --git a/roles/proxy/tasks/main.yml b/roles/proxy/tasks/main.yml index 6a71684..ceb8ee9 100644 --- a/roles/proxy/tasks/main.yml +++ b/roles/proxy/tasks/main.yml @@ -1,3 +1,9 @@ +# Check for compatible Ansible version. +- name: Check for compatible Ansible version. + assert: + that: ansible_version.full is version_compare('2.16', '>=') + msg: You need Ansible version 2.16 or higher. + # Setup nginx proxy - include_tasks: nginx.yml diff --git a/roles/proxy/tasks/nginx.yml b/roles/proxy/tasks/nginx.yml index dd40a2f..484706b 100644 --- a/roles/proxy/tasks/nginx.yml +++ b/roles/proxy/tasks/nginx.yml @@ -122,6 +122,7 @@ src: artemis-ssh-upstream.conf.j2 dest: /etc/nginx/artemis-ssh-upstream.conf mode: 0644 + when: proxy_forward_ssh notify: restart nginx - name: Copy timeouts.conf diff --git a/roles/proxy/templates/nginx_proxy.conf.j2 b/roles/proxy/templates/nginx_proxy.conf.j2 index e346b28..fce1c07 100644 --- a/roles/proxy/templates/nginx_proxy.conf.j2 +++ b/roles/proxy/templates/nginx_proxy.conf.j2 @@ -1,7 +1,7 @@ {{ ansible_managed | comment }} # Load balancing -upstream artemis { +upstream app { {% if proxy_load_balancing_method is defined %} {{ proxy_load_balancing_method }}; {% endif %} @@ -62,7 +62,7 @@ server { client_body_buffer_size 1m; location / { - proxy_pass {{ proxy_node_protocol }}://artemis; + proxy_pass {{ proxy_node_protocol }}://app; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; @@ -93,7 +93,7 @@ server { {% endif %} location /api/authenticate { - proxy_pass http://artemis/api/authenticate; + proxy_pass http://app/api/authenticate; # For a given violation of the rate limit defined in the zone # * the first 2 (delay) requests will be allowed without delay # * the next (burst - delay) request waits until it fits in the rate limit