# mautic.ERROR: Uncaught PHP Exception

**URL:** https://forum.mautic.org/t/mautic-error-uncaught-php-exception/16983
**Category:** Product Support
**Created:** [November 11, 2020, 6:29pm UTC](https://forum.mautic.org/t/mautic-error-uncaught-php-exception/16983 "2020-11-11T18:29:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![imog](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/imog/32/3813_2.png) [@imog](https://forum.mautic.org/u/imog)
#### Post date: [November 11, 2020, 6:29pm UTC](https://forum.mautic.org/t/mautic-error-uncaught-php-exception/16983/1 "2020-11-11T18:29:01Z")

</div>

**Your software**  
My Mautic version is: 3.1.2  
My PHP version is: 7.3  
My Database type and version is: 5.7

**Your problem**  
Besides that Mautic seems to run without errors i find those logs below.  
I run Mautic behind a Nginx reverse-proxy and have added  
$\_SERVER[‘HTTPS’] = ‘on’;  
to start of index.php of Mautic.  
The SSL-Termination is done at the revprox.

These errors are showing in the log:  
[2020-11-11 14:50:43] mautic.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\BadRequestHttpException: “Untrusted Host “89.239.2.123”.” at /systems/mautic/htdocs/vendor/symfony/http-kernel/HttpKernel.php line 71 {“exception”:"[object] (Symfony\Component\HttpKernel\Exception\BadRequestHttpException(code: 0): Untrusted Host “89.239.2.123”. at /systems/mautic/htdocs/vendor/symfony/http-kernel/HttpKernel.php:71, Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException(code: 0): Untrusted Host “89.239.2.123”. at /systems/mautic/htdocs/vendor/symfony/http-foundation/Request.php:1319)"}

---

<div class="post-metadata">

### Author: ![codes9](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/codes9/32/682_2.png) [@codes9](https://forum.mautic.org/u/codes9)
#### Post date: [November 11, 2020, 10:01pm UTC](https://forum.mautic.org/t/mautic-error-uncaught-php-exception/16983/2 "2020-11-11T22:01:18Z")

</div>

> [@imog](#):
>
> Symfony\Component\HttpKernel\Exception\BadRequestHttpException: “Untrusted Host

❗ Ensure this IP belongs to you. It may be a true CORS request.

**If this ip belongs to you follow these steps:**

Did you setup CORS in the config section in Mautic? Either remove this feature or add the ip of your Ngnix proxy i.e. 89.239.2.123.  
**You can alternatively change this in local.php:**

You probably have something like this in the local.php  
` trusted_hosts: - "%domain%"`  
either remove it or add the IP

---

<div class="post-metadata">

### Author: ![imog](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/imog/32/3813_2.png) [@imog](https://forum.mautic.org/u/imog)
#### Post date: [November 11, 2020, 10:07pm UTC](https://forum.mautic.org/t/mautic-error-uncaught-php-exception/16983/3 "2020-11-11T22:07:38Z")

</div>

Yes, the IP belongs to the Mautic reverse proxy. And i also setup CORS:

```
    'cors_restrict_domains' => 1,
    'cors_valid_domains' => array(
            '0' => 'https://mautic.my.domain',
    ),

```

The URL [https://mautic.my.domain](https://mautic.my.domain) points to the abovie IP address 89.239.2.123 (of course this i anonymized and not my real address and name, as i do not want to post it here in public).

The trusted hosts is set to:

```
    trusted_hosts' => array(
    '0' => '.*\\.my\\.domain$'
    ),
```

---

<div class="post-metadata">

### Author: ![codes9](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/codes9/32/682_2.png) [@codes9](https://forum.mautic.org/u/codes9)
#### Post date: [November 11, 2020, 10:19pm UTC](https://forum.mautic.org/t/mautic-error-uncaught-php-exception/16983/4 "2020-11-11T22:19:52Z")

</div>

> of course this i anonymized and not my real address and name, as i do not want to post it here in public

Perfectly understandable. If you ever really need to you can use a PM. But in this case confirming you’ve checked it is enough.

What happens if you add the ip address to your CORS config?
