IP address to trusted_host_patterns
Your regex is incorrect. You placed the second and third \ after the . instead of before.

$settings['trusted_host_patterns'] = array(
  '^172\.20\.0\.3$',
  '^localhost$',
);