Skip to content

Commit

Permalink
Merge pull request #72 from alphagov/add-private_extra_vcl_recv-back
Browse files Browse the repository at this point in the history
Allow to configure private extra vcl_recv for www and DGU
  • Loading branch information
AgaDufrat authored Apr 10, 2024
2 parents 9039f36 + 7e108f8 commit 1497055
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/datagovuk/datagovuk.vcl.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ sub vcl_recv {
if (!req.http.Fastly-SSL) {
error 801 "Force SSL";
}

%{ if private_extra_vcl_recv != "" ~}
${private_extra_vcl_recv}
%{ endif ~}

${indent(2, file("${module_path}/../shared/_security_txt_request.vcl"))}

Expand Down
2 changes: 2 additions & 0 deletions modules/datagovuk/service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ locals {
gcs_mirror_prefix = null
gcs_mirror_probe = null
gcs_mirror_port = 443

private_extra_vcl_recv = ""
},
{ # computed values
formatted_allowed_ip_addresses = local.formatted_allowed_ips
Expand Down
1 change: 1 addition & 0 deletions modules/www/service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ locals {
gcs_mirror_probe = null
gcs_mirror_port = 443

private_extra_vcl_recv = ""
ab_tests = []
},
{ # computed values
Expand Down
4 changes: 4 additions & 0 deletions modules/www/www.vcl.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ sub vcl_recv {
if (!req.http.Fastly-SSL) {
error 801 "Force SSL";
}

%{ if private_extra_vcl_recv != "" ~}
${private_extra_vcl_recv}
%{ endif ~}

${indent(2, file("${module_path}/../shared/_security_txt_request.vcl"))}

Expand Down

0 comments on commit 1497055

Please sign in to comment.