<commit_before># Varnish will append its default logic to any overwritten subroutine. If
# you're not sure what that is, see here:
#
#   https://www.varnish-cache.org/trac/browser/bin/varnishd/default.vcl?rev=3.0

acl purge_acl {
  "localhost";
}



# Defining the backends per-director so we can have separate healthchecks later
backend admin_backend {
    .host = "backend-app-1";
}
backend write_backend {
    .host = "backend-app-1";
}
backend read_backend {
    .host = "backend-app-1";
}
backend stagecraft_backend {
    .host = "backend-app-1";
}

sub redirect_slash {
  # http://example.org/foo/ -> http://example.org/foo
  # vcl_error completes the redirect
  # Don't redirect "/" to "".
  if (req.request ~ "^(GET|HEAD|OPTIONS)$" && req.url ~ "(.+)/$") {
    set req.http.x-Redir-Url = regsub(req.url, "^(.+)/$", "\1");
    error 667 req.http.x-Redir-Url;
  }
}

sub vcl_recv {
  # Routing
  if (req.http.Host ~ "^admin\..*") {
    # Send admin requests to admin.backdrop
    set req.http.Host = "admin.backdrop";
    set req.backend   = admin_backend;
    call redirect_slash;
  } else if (req.http.Host ~ "^stagecraft\..*") {
    # Send stagecraft requests to stagecraft
    set req.http.Host = "stagecraft";
    set req.backend   = stagecraft_backend;
  } else if (req.http.Host ~ "^www\..*") {
    # Send www requests to backdrop
    if (req.request == "POST") {
      if (req.http.Authorization ~ "^Bearer .*") {<commit_msg>Do not set stagecraft hostname in dev vcl<commit_after># Varnish will append its default logic to any overwritten subroutine. If
# you're not sure what that is, see here:
#
#   https://www.varnish-cache.org/trac/browser/bin/varnishd/default.vcl?rev=3.0

acl purge_acl {
  "localhost";
}



# Defining the backends per-director so we can have separate healthchecks later
backend admin_backend {
    .host = "backend-app-1";
}
backend write_backend {
    .host = "backend-app-1";
}
backend read_backend {
    .host = "backend-app-1";
}
backend stagecraft_backend {
    .host = "backend-app-1";
}

sub redirect_slash {
  # http://example.org/foo/ -> http://example.org/foo
  # vcl_error completes the redirect
  # Don't redirect "/" to "".
  if (req.request ~ "^(GET|HEAD|OPTIONS)$" && req.url ~ "(.+)/$") {
    set req.http.x-Redir-Url = regsub(req.url, "^(.+)/$", "\1");
    error 667 req.http.x-Redir-Url;
  }
}

sub vcl_recv {
  # Routing
  if (req.http.Host ~ "^admin\..*") {
    # Send admin requests to admin.backdrop
    set req.http.Host = "admin.backdrop";
    set req.backend   = admin_backend;
    call redirect_slash;
  } else if (req.http.Host ~ "^stagecraft\..*") {
    # Send stagecraft requests to stagecraft
    set req.backend   = stagecraft_backend;
  } else if (req.http.Host ~ "^www\..*") {
    # Send www requests to backdrop
    if (req.request == "POST") {
      if (req.http.Authorization ~ "^Bearer .*") {
{'fraction_non_alphanumeric': 0.16108786610878661, 'fraction_numerical': 0.00697350069735007, 'mean_word_length': 3.0408450704225354, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '251088', 'n_tokens_mistral': 1050, 'n_tokens_neox': 1005, 'n_words': 248}