Simplify proxy template

pull/14/head
Emilien Mantel 2016-01-22 09:36:52 +01:00
parent 51a1105dff
commit 7f56db76e0
2 changed files with 9 additions and 10 deletions

View File

@ -1,16 +1,13 @@
{% extends "_base.j2" %} {% extends "_base.j2" %}
{% block template_try_files %} {% block root %}
proxy_set_header Host $host; {% if item.root is defined %}
proxy_set_header X-Real-IP $remote_addr; root {{ item.root }};
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; {% endif %}
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://{{ item.upstream_name }};
proxy_read_timeout 90;
{#proxy_redirect http://{{ upstream.name }} https://jenkins.domain.tld;#}
{% block template_try_files %}
include /etc/nginx/proxy_params;
proxy_pass http://{{ item.upstream_name }};
{% if item.proxy_params is defined and item.proxy_params is iterable %} {% if item.proxy_params is defined and item.proxy_params is iterable %}
{% for param in item.proxy_params %} {% for param in item.proxy_params %}
{{ param }} {{ param }}

View File

@ -157,6 +157,8 @@
- 8080 - 8080
template: '_proxy' template: '_proxy'
upstream_name: 'test' upstream_name: 'test'
more:
- 'add_header X-proxyfied 1;'
- name: 'deleted.local' - name: 'deleted.local'
delete: true delete: true
- name: 'redirect-to.local' - name: 'redirect-to.local'