boost-proxy: comments in english
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
This commit is contained in:
parent
071ac2bafb
commit
d03910d5f8
|
@ -169,7 +169,7 @@ frontend external
|
||||||
http-request set-header x-forwarded-proto http if !{ ssl_fc }
|
http-request set-header x-forwarded-proto http if !{ ssl_fc }
|
||||||
http-request set-header x-forwarded-proto https if { ssl_fc }
|
http-request set-header x-forwarded-proto https if { ssl_fc }
|
||||||
|
|
||||||
# BEGIN marquage HTTP
|
# BEGIN HTTP tagging
|
||||||
acl xid_req_exists req.hdr(x-request-id) -m found
|
acl xid_req_exists req.hdr(x-request-id) -m found
|
||||||
http-request set-var(txn.xid) req.hdr(x-request-id) if xid_req_exists
|
http-request set-var(txn.xid) req.hdr(x-request-id) if xid_req_exists
|
||||||
http-request set-var(txn.xid) uuid() unless xid_req_exists
|
http-request set-var(txn.xid) uuid() unless xid_req_exists
|
||||||
|
@ -193,7 +193,7 @@ frontend external
|
||||||
# Uncomment to enable
|
# Uncomment to enable
|
||||||
### http-response set-header x-haproxy-log-external "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r"
|
### http-response set-header x-haproxy-log-external "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
# END marquage HTTP
|
# END HTTP tagging
|
||||||
|
|
||||||
# Global maintenance mode
|
# Global maintenance mode
|
||||||
# Uncomment to enable
|
# Uncomment to enable
|
||||||
|
@ -207,7 +207,7 @@ frontend external
|
||||||
{% for site in boost_sites_enabled %}
|
{% for site in boost_sites_enabled %}
|
||||||
# BEGIN frontend_external section for site '{{ site }}'
|
# BEGIN frontend_external section for site '{{ site }}'
|
||||||
{% include "templates/boost-sites/" + site + "/haproxy/frontend_external.j2" %}
|
{% include "templates/boost-sites/" + site + "/haproxy/frontend_external.j2" %}
|
||||||
{# Ne pas enlever la ligne vide ci-dessous #}
|
{# Do not remove the blank line below #}
|
||||||
|
|
||||||
# END frontend_external section for site '{{ site }}'
|
# END frontend_external section for site '{{ site }}'
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -241,7 +241,7 @@ frontend internal
|
||||||
# Keep header if present and coming from Varnish
|
# Keep header if present and coming from Varnish
|
||||||
http-request set-header x-forwarded-proto %[req.hdr(x-forwarded-proto)] if forwarded_proto varnish_from
|
http-request set-header x-forwarded-proto %[req.hdr(x-forwarded-proto)] if forwarded_proto varnish_from
|
||||||
|
|
||||||
# BEGIN marquage HTTP
|
# BEGIN HTTP tagging
|
||||||
http-request set-header x-boost-step3 "haproxy-internal"
|
http-request set-header x-boost-step3 "haproxy-internal"
|
||||||
|
|
||||||
http-response set-header x-boost-step3 "haproxy-internal; ssl-backend" if { ssl_bc }
|
http-response set-header x-boost-step3 "haproxy-internal; ssl-backend" if { ssl_bc }
|
||||||
|
@ -254,12 +254,12 @@ frontend internal
|
||||||
# Uncomment to enable
|
# Uncomment to enable
|
||||||
### http-response set-header x-haproxy-log-internal "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r"
|
### http-response set-header x-haproxy-log-internal "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
# END marquage HTTP
|
# END HTTP tagging
|
||||||
|
|
||||||
{% for site in boost_sites_enabled %}
|
{% for site in boost_sites_enabled %}
|
||||||
# BEGIN frontend_internal section for site '{{ site }}'
|
# BEGIN frontend_internal section for site '{{ site }}'
|
||||||
{% include "templates/boost-sites/" + site + "/haproxy/frontend_internal.j2" %}
|
{% include "templates/boost-sites/" + site + "/haproxy/frontend_internal.j2" %}
|
||||||
{# Ne pas enlever la ligne vide ci-dessous #}
|
{# Do not remove the blank line below #}
|
||||||
|
|
||||||
# END frontend_internal section for site '{{ site }}'
|
# END frontend_internal section for site '{{ site }}'
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -272,21 +272,21 @@ backend varnish
|
||||||
{% for site in boost_sites_enabled %}
|
{% for site in boost_sites_enabled %}
|
||||||
# BEGIN backend section for site '{{ site }}'
|
# BEGIN backend section for site '{{ site }}'
|
||||||
{% include "templates/boost-sites/" + site + "/haproxy/backend.j2" %}
|
{% include "templates/boost-sites/" + site + "/haproxy/backend.j2" %}
|
||||||
{# Ne pas enlever la ligne vide ci-dessous #}
|
{# Do not remove the blank line below #}
|
||||||
|
|
||||||
# END backend section for site '{{ site }}'
|
# END backend section for site '{{ site }}'
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
backend letsencrypt
|
backend letsencrypt
|
||||||
{% if boost_certificates_server is not defined or boost_certificates_server == inventory_hostname %}
|
{% if boost_certificates_server is not defined or boost_certificates_server == inventory_hostname %}
|
||||||
server localhost 127.0.0.1:{{ boost_nginx_port }} send-proxy-v2 maxconn 10
|
server localhost 127.0.0.1:{{ boost_nginx_proxy_port | mandatory }} send-proxy-v2 maxconn 10
|
||||||
{% else %}
|
{% else %}
|
||||||
server {{ boost_certificates_server }} {{ hostvars[boost_certificates_server].ansible_host }}:80 maxconn 10
|
server {{ boost_certificates_server }} {{ hostvars[boost_certificates_server].ansible_host }}:{{ boost_nginx_proxy_port | mandatory }} maxconn 10
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
backend local
|
backend local
|
||||||
option httpchk HEAD {{ boost_nginx_check_url | mandatory }}
|
option httpchk HEAD {{ boost_nginx_check_url | mandatory }}
|
||||||
server localhost 127.0.0.1:81 send-proxy-v2 maxconn 10
|
server localhost 127.0.0.1:{{ boost_nginx_proxy_port | mandatory }} send-proxy-v2 maxconn 10
|
||||||
|
|
||||||
backend maintenance
|
backend maintenance
|
||||||
http-request set-log-level silent
|
http-request set-log-level silent
|
||||||
|
|
|
@ -65,11 +65,11 @@ sub vcl_recv {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# BEGIN marquage HTTP
|
# BEGIN HTTP tagging
|
||||||
# TODO: ajouter un en-tête pour marquer le passage dans les 3 composants
|
# TODO: ajouter un en-tête pour marquer le passage dans les 3 composants
|
||||||
# avec une artie permanente et une partie optionnelle commentée par défaut
|
# avec une artie permanente et une partie optionnelle commentée par défaut
|
||||||
set req.http.X-Boost-Layer = "varnish";
|
set req.http.X-Boost-Layer = "varnish";
|
||||||
# END marquage HTTP
|
# END HTTP tagging
|
||||||
}
|
}
|
||||||
|
|
||||||
sub vcl_backend_response {
|
sub vcl_backend_response {
|
||||||
|
@ -96,7 +96,7 @@ sub vcl_deliver {
|
||||||
|
|
||||||
unset resp.http.Via;
|
unset resp.http.Via;
|
||||||
|
|
||||||
# BEGIN marquage HTTP
|
# BEGIN HTTP tagging
|
||||||
# TODO: ajouter un en-tête pour marquer le passage dans les 3 composants
|
# TODO: ajouter un en-tête pour marquer le passage dans les 3 composants
|
||||||
# avec une partie permanente et une partie optionnelle commentée par défaut
|
# avec une partie permanente et une partie optionnelle commentée par défaut
|
||||||
if (resp.http.Set-Cookie && resp.http.Cache-Control) {
|
if (resp.http.Set-Cookie && resp.http.Cache-Control) {
|
||||||
|
@ -108,7 +108,7 @@ sub vcl_deliver {
|
||||||
} else {
|
} else {
|
||||||
set resp.http.X-Boost-Step2 = "varnish; no-set-cookie; no-cache-control";
|
set resp.http.X-Boost-Step2 = "varnish; no-set-cookie; no-cache-control";
|
||||||
}
|
}
|
||||||
# END marquage HTTP
|
# END HTTP tagging
|
||||||
|
|
||||||
if (resp.http.X-Varnish ~ "[0-9]+ +[0-9]+") {
|
if (resp.http.X-Varnish ~ "[0-9]+ +[0-9]+") {
|
||||||
set resp.http.X-Cache = "HIT";
|
set resp.http.X-Cache = "HIT";
|
||||||
|
|
Loading…
Reference in a new issue