I'm trying to enable the trusted host settings, but I cannot write a proper regex. I have a standard forwarding where http://mydomain.com is forwarded to http://xx.xxx.xx.xx/soa/index.php.

The only pattern that works is one that allows everything:

$settings['trusted_host_patterns'] = array(
 '^.*$',
);

Anything else I attempt results in

The provided host name is not valid for this server.

Example:

$settings['trusted_host_patterns'] = array(
 '^www\.mydomain\.com$',
 '^http\:\/\/mydomain\.com$',
 '^http\:\/\/xx\.xxx\.xx\.xx\/soa\/index\.php$',
);