This commit is contained in:
parent
e4be00e42f
commit
00c68173c9
@ -7,6 +7,7 @@
|
|||||||
{%- set users = salt['pillar.get']('htpasswds') -%}
|
{%- set users = salt['pillar.get']('htpasswds') -%}
|
||||||
{%- set net = salt['pillar.get']('net') -%}
|
{%- set net = salt['pillar.get']('net') -%}
|
||||||
{%- set fqdn = salt['grains.get']('fqdn') -%}
|
{%- set fqdn = salt['grains.get']('fqdn') -%}
|
||||||
|
{%- set country = salt['grains.get']('country') -%}
|
||||||
|
|
||||||
{% set peers_ip = [] %}
|
{% set peers_ip = [] %}
|
||||||
{%- for k,v in haproxy.peers.items() %}
|
{%- for k,v in haproxy.peers.items() %}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
|
## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
|
||||||
{%- from "haproxy/map.jinja" import haproxy,certs,fqdn with context %}
|
{%- from "haproxy/map.jinja" import haproxy,fqdn,country with context %}
|
||||||
|
|
||||||
{%- set ns = namespace(default_backend='notdefined') %}
|
{%- set ns = namespace(default_backend='notdefined') %}
|
||||||
{%- for name, values in haproxy.config.vhosts.items() %}{% if values.default_backend|default(false) %}{% set ns.default_backend = name %}{% endif %}{% endfor %}
|
{%- for name, values in haproxy.config.vhosts.items() %}{% if values.default_backend|default(false) %}{% set ns.default_backend = name %}{% endif %}{% endfor %}
|
||||||
@ -93,6 +93,7 @@ global
|
|||||||
server-state-file /var/run/haproxy.state
|
server-state-file /var/run/haproxy.state
|
||||||
mworker-max-reloads 2
|
mworker-max-reloads 2
|
||||||
maxconn 1000
|
maxconn 1000
|
||||||
|
set-var proc.country str('{{ country }}')
|
||||||
lua-prepend-path {{ haproxy.config.dir }}/mods/?.so cpath
|
lua-prepend-path {{ haproxy.config.dir }}/mods/?.so cpath
|
||||||
lua-prepend-path {{ haproxy.config.dir }}/scripts/?.lua
|
lua-prepend-path {{ haproxy.config.dir }}/scripts/?.lua
|
||||||
{%- for script,params in haproxy.config.scripts.items() %}
|
{%- for script,params in haproxy.config.scripts.items() %}
|
||||||
@ -175,7 +176,7 @@ frontend fe_http from {{ haproxy.config.namespace }}
|
|||||||
## Returns
|
## Returns
|
||||||
http-request return status 200 content-type text/plain string "User-agent: *\r\nAllow: /" if robots_txt
|
http-request return status 200 content-type text/plain string "User-agent: *\r\nAllow: /" if robots_txt
|
||||||
http-request return status 200 content-type text/plain string "Contact: mailto:{{ haproxy.config.syscontact }}" if security_txt
|
http-request return status 200 content-type text/plain string "Contact: mailto:{{ haproxy.config.syscontact }}" if security_txt
|
||||||
http-request return status 200 content-type "text/html; charset=utf-8" lf-string "<html><body>host: %H<br/>date: %[var(txn.httpdate)]<br/>src: %[var(req.src)]<br/>srchash: %[var(txn.srchash)]</body></html>" if self_host path_info
|
http-request return status 200 content-type "text/html; charset=utf-8" lf-string "<html><body>host: %H<br/>country: %[var(proc.country)]<br/>date: %[var(txn.httpdate)]<br/>src: %[var(req.src)]<br/>srchash: %[var(txn.srchash)]</body></html>" if self_host path_info
|
||||||
|
|
||||||
{%- if haproxy.config.geoip.enabled %}
|
{%- if haproxy.config.geoip.enabled %}
|
||||||
## GeoIP
|
## GeoIP
|
||||||
@ -244,7 +245,7 @@ frontend fe_https from {{ haproxy.config.namespace }}
|
|||||||
## Returns
|
## Returns
|
||||||
http-request return status 200 content-type text/plain string "User-agent: *\r\nAllow: /" if robots_txt
|
http-request return status 200 content-type text/plain string "User-agent: *\r\nAllow: /" if robots_txt
|
||||||
http-request return status 200 content-type text/plain string "Contact: mailto:{{ haproxy.config.syscontact }}" if security_txt
|
http-request return status 200 content-type text/plain string "Contact: mailto:{{ haproxy.config.syscontact }}" if security_txt
|
||||||
http-request return status 200 content-type "text/html; charset=utf-8" lf-string "<html><body>host: %H<br/>date: %[var(txn.httpdate)]<br/>src: %[var(req.src)]<br/>srchash: %[var(txn.srchash)]</body></html>" if self_host path_info
|
http-request return status 200 content-type "text/html; charset=utf-8" lf-string "<html><body>host: %H<br/>country: %[var(proc.country)]<br/>date: %[var(txn.httpdate)]<br/>src: %[var(req.src)]<br/>srchash: %[var(txn.srchash)]</body></html>" if self_host path_info
|
||||||
|
|
||||||
## Headers
|
## Headers
|
||||||
http-request set-header X-Proxy-Id "%H"
|
http-request set-header X-Proxy-Id "%H"
|
||||||
|
Loading…
Reference in New Issue
Block a user