Simplify proxy template
parent
51a1105dff
commit
7f56db76e0
|
@ -1,16 +1,13 @@
|
||||||
{% extends "_base.j2" %}
|
{% extends "_base.j2" %}
|
||||||
|
|
||||||
|
{% block root %}
|
||||||
|
{% if item.root is defined %}
|
||||||
|
root {{ item.root }};
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block template_try_files %}
|
{% block template_try_files %}
|
||||||
proxy_set_header Host $host;
|
include /etc/nginx/proxy_params;
|
||||||
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_pass http://{{ item.upstream_name }};
|
||||||
proxy_read_timeout 90;
|
|
||||||
|
|
||||||
{#proxy_redirect http://{{ upstream.name }} https://jenkins.domain.tld;#}
|
|
||||||
|
|
||||||
{% 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 }}
|
||||||
|
|
|
@ -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'
|
||||||
|
|
Loading…
Reference in New Issue