mirror of
https://github.com/bunkerity/bunkerized-nginx
synced 2023-12-13 21:30:18 +01:00
fix missing Strict-Transport-Policy header, fix X-Forwarded-Prefix with regex URLs and print logs when UI tests failed
This commit is contained in:
parent
26f2852e54
commit
bf9cd367d0
4 changed files with 10 additions and 4 deletions
|
@ -171,6 +171,7 @@ helpers.fill_ctx = function()
|
|||
data.http_content_length = ngx.var.http_content_length
|
||||
data.http_origin = ngx.var.http_origin
|
||||
data.http_version = ngx.req.http_version()
|
||||
data.scheme = ngx.var.scheme
|
||||
end
|
||||
-- IP data : global
|
||||
local ip_is_global, err = utils.ip_is_global(data.remote_addr)
|
||||
|
|
|
@ -71,9 +71,7 @@ end
|
|||
|
||||
function headers:header()
|
||||
-- Override upstream headers if needed
|
||||
local ssl = self.variables["AUTO_LETS_ENCRYPT"] == "yes" or
|
||||
self.variables["USE_CUSTOM_SSL"] == "yes" or
|
||||
self.variables["GENERATE_SELF_SIGNED_SSL"] == "yes"
|
||||
local ssl = self.ctx.bw.scheme == "https"
|
||||
for variable, header in pairs(self.all_headers) do
|
||||
if ngx.header[header] == nil or (self.variables[variable] ~= "" and self.variables["KEEP_UPSTREAM_HEADERS"] ~= "*" and utils.regex_match(self.variables["KEEP_UPSTREAM_HEADERS"], "(^| )" .. header .. "($| )") == nil) then
|
||||
if (header ~= "Strict-Transport-Security" or ssl) then
|
||||
|
|
|
@ -48,7 +48,9 @@ location {{ url }} {% raw %}{{% endraw +%}
|
|||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Protocol $scheme;
|
||||
proxy_set_header X-Forwarded-Host $http_host;
|
||||
{% if url.startswith("/") +%}
|
||||
proxy_set_header X-Forwarded-Prefix "{{ url }}";
|
||||
{% endif %}
|
||||
{% if buffering == "yes" +%}
|
||||
proxy_buffering on;
|
||||
{% else +%}
|
||||
|
|
|
@ -50,6 +50,11 @@ if [ $? -ne 0 ] ; then
|
|||
exit 1
|
||||
fi
|
||||
docker-compose -f docker-compose.test.yml up --abort-on-container-exit --exit-code-from ui-tests
|
||||
ret=$?
|
||||
if [ $ret -ne 0 ] ; then
|
||||
docker-compose -f docker-compose.test.yml logs
|
||||
echo "❌ Up failed"
|
||||
fi
|
||||
|
||||
# Exit
|
||||
exit $?
|
||||
exit $ret
|
Loading…
Reference in a new issue