1
0

split request/response headers configuration

This commit is contained in:
Konstantin Demin 2024-11-08 12:10:06 +03:00
parent 9b99cb39fb
commit 99696ed5d9
Signed by: krd
GPG Key ID: 4D56F87A8BA65FD0
17 changed files with 52 additions and 35 deletions

View File

@ -0,0 +1 @@
include snip.d/http-response-headers;

View File

@ -0,0 +1,2 @@
include snip.d/fastcgi-request-headers;
include snip.d/fastcgi-response-headers;

View File

@ -0,0 +1,2 @@
include snip.d/grpc-request-headers;
include snip.d/grpc-response-headers;

View File

@ -0,0 +1,2 @@
include snip.d/proxy-request-headers;
include snip.d/proxy-response-headers;

View File

@ -0,0 +1,2 @@
include snip.d/scgi-request-headers;
include snip.d/scgi-response-headers;

View File

@ -0,0 +1,2 @@
include snip.d/uwsgi-request-headers;
include snip.d/uwsgi-response-headers;

View File

@ -1,13 +1,7 @@
## sourced by conf.d/fastcgi/headers.conf
## hide/remove request headers ## hide/remove request headers
{%- set req_hdr_dict = j2cfg.request_headers or {} -%} {%- set req_hdr_dict = j2cfg.request_headers or {} -%}
{%- for h, v in req_hdr_dict.items() %} {%- for h, v in req_hdr_dict.items() %}
{#- TODO: precise quotation #} {#- TODO: precise quotation #}
fastcgi_param {{ h | as_cgi_header }} {{ v.__repr__() }}; fastcgi_param {{ h | as_cgi_header }} {{ v.__repr__() }};
{%- endfor %}
## hide response headers
{%- set resp_hdr_dict = j2cfg.response_headers or {} -%}
{%- set resp_hdr_list = resp_hdr_dict | dict_keys -%}
{%- for h in resp_hdr_list %}
fastcgi_hide_header {{ h }};
{%- endfor %} {%- endfor %}

View File

@ -0,0 +1,7 @@
## sourced by conf.d/fastcgi/headers.conf
## hide response headers
{%- set resp_hdr_dict = j2cfg.response_headers or {} -%}
{%- set resp_hdr_list = resp_hdr_dict | dict_keys -%}
{%- for h in resp_hdr_list %}
fastcgi_hide_header {{ h }};
{%- endfor %}

View File

@ -1,13 +1,7 @@
## sourced by conf.d/grpc/headers.conf
## hide/remove request headers ## hide/remove request headers
{%- set req_hdr_dict = j2cfg.request_headers or {} -%} {%- set req_hdr_dict = j2cfg.request_headers or {} -%}
{%- for h, v in req_hdr_dict.items() %} {%- for h, v in req_hdr_dict.items() %}
{#- TODO: precise quotation #} {#- TODO: precise quotation #}
grpc_set_header {{ h }} {{ v.__repr__() }}; grpc_set_header {{ h }} {{ v.__repr__() }};
{%- endfor %}
## hide response headers
{%- set resp_hdr_dict = j2cfg.response_headers or {} -%}
{%- set resp_hdr_list = resp_hdr_dict | dict_keys -%}
{%- for h in resp_hdr_list %}
grpc_hide_header {{ h }};
{%- endfor %} {%- endfor %}

View File

@ -0,0 +1,7 @@
## sourced by conf.d/grpc/headers.conf
## hide response headers
{%- set resp_hdr_dict = j2cfg.response_headers or {} -%}
{%- set resp_hdr_list = resp_hdr_dict | dict_keys -%}
{%- for h in resp_hdr_list %}
grpc_hide_header {{ h }};
{%- endfor %}

View File

@ -1,3 +1,4 @@
## sourced by autoconf.d/http-response-headers.conf
## add response headers ## add response headers
{%- set resp_hdr_dict = j2cfg.response_headers or {} -%} {%- set resp_hdr_dict = j2cfg.response_headers or {} -%}
{%- for h, v in resp_hdr_dict.items() %} {%- for h, v in resp_hdr_dict.items() %}

View File

@ -1,13 +1,7 @@
## sourced by conf.d/proxy-http/headers.conf
## hide/remove request headers ## hide/remove request headers
{%- set req_hdr_dict = j2cfg.request_headers or {} -%} {%- set req_hdr_dict = j2cfg.request_headers or {} -%}
{%- for h, v in req_hdr_dict.items() %} {%- for h, v in req_hdr_dict.items() %}
{#- TODO: precise quotation #} {#- TODO: precise quotation #}
proxy_set_header {{ h }} {{ v.__repr__() }}; proxy_set_header {{ h }} {{ v.__repr__() }};
{%- endfor %}
## hide response headers
{%- set resp_hdr_dict = j2cfg.response_headers or {} -%}
{%- set resp_hdr_list = resp_hdr_dict | dict_keys -%}
{%- for h in resp_hdr_list %}
proxy_hide_header {{ h }};
{%- endfor %} {%- endfor %}

View File

@ -0,0 +1,7 @@
## sourced by conf.d/proxy-http/headers.conf
## hide response headers
{%- set resp_hdr_dict = j2cfg.response_headers or {} -%}
{%- set resp_hdr_list = resp_hdr_dict | dict_keys -%}
{%- for h in resp_hdr_list %}
proxy_hide_header {{ h }};
{%- endfor %}

View File

@ -1,13 +1,7 @@
## sourced by conf.d/scgi/headers.conf
## hide/remove request headers ## hide/remove request headers
{%- set req_hdr_dict = j2cfg.request_headers or {} -%} {%- set req_hdr_dict = j2cfg.request_headers or {} -%}
{%- for h, v in req_hdr_dict.items() %} {%- for h, v in req_hdr_dict.items() %}
{#- TODO: precise quotation #} {#- TODO: precise quotation #}
scgi_param {{ h | as_cgi_header }} {{ v.__repr__() }}; scgi_param {{ h | as_cgi_header }} {{ v.__repr__() }};
{%- endfor %}
## hide response headers
{%- set resp_hdr_dict = j2cfg.response_headers or {} -%}
{%- set resp_hdr_list = resp_hdr_dict | dict_keys -%}
{%- for h in resp_hdr_list %}
scgi_hide_header {{ h }};
{%- endfor %} {%- endfor %}

View File

@ -0,0 +1,7 @@
## sourced by conf.d/scgi/headers.conf
## hide response headers
{%- set resp_hdr_dict = j2cfg.response_headers or {} -%}
{%- set resp_hdr_list = resp_hdr_dict | dict_keys -%}
{%- for h in resp_hdr_list %}
scgi_hide_header {{ h }};
{%- endfor %}

View File

@ -1,13 +1,7 @@
## sourced by conf.d/uwsgi/headers.conf
## hide/remove request headers ## hide/remove request headers
{%- set req_hdr_dict = j2cfg.request_headers or {} -%} {%- set req_hdr_dict = j2cfg.request_headers or {} -%}
{%- for h, v in req_hdr_dict.items() %} {%- for h, v in req_hdr_dict.items() %}
{#- TODO: precise quotation #} {#- TODO: precise quotation #}
uwsgi_param {{ h | as_cgi_header }} {{ v.__repr__() }}; uwsgi_param {{ h | as_cgi_header }} {{ v.__repr__() }};
{%- endfor %}
## hide response headers
{%- set resp_hdr_dict = j2cfg.response_headers or {} -%}
{%- set resp_hdr_list = resp_hdr_dict | dict_keys -%}
{%- for h in resp_hdr_list %}
uwsgi_hide_header {{ h }};
{%- endfor %} {%- endfor %}

View File

@ -0,0 +1,7 @@
## sourced by conf.d/uwsgi/headers.conf
## hide response headers
{%- set resp_hdr_dict = j2cfg.response_headers or {} -%}
{%- set resp_hdr_list = resp_hdr_dict | dict_keys -%}
{%- for h in resp_hdr_list %}
uwsgi_hide_header {{ h }};
{%- endfor %}