mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-03-14 10:32:10 +07:00
Simplify proxy template
This commit is contained in:
@@ -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'
|
||||||
|
|||||||
Reference in New Issue
Block a user