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" %}
{% block template_try_files %}
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
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 root %}
{% if item.root is defined %}
root {{ item.root }};
{% endif %}
{% 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 %}
{% for param in item.proxy_params %}
{{ param }}

View File

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