# Mautic Failed after updating CORS Settings

**URL:** https://forum.mautic.org/t/mautic-failed-after-updating-cors-settings/14450
**Category:** Product Support
**Created:** [May 22, 2020, 10:56am UTC](https://forum.mautic.org/t/mautic-failed-after-updating-cors-settings/14450 "2020-05-22T10:56:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![adityaduggal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/adityaduggal/32/2467_2.png) [@adityaduggal](https://forum.mautic.org/u/adityaduggal)
#### Post date: [May 22, 2020, 10:56am UTC](https://forum.mautic.org/t/mautic-failed-after-updating-cors-settings/14450/1 "2020-05-22T10:56:55Z")

</div>

**Your software**  
My Mautic version is: 2.16.2  
My PHP version is: 7.2.31

**Your problem**  
My problem is: Well I have just started using mautic and honestly the first impression is that its indeed a very impressive piece of software. Kudos to the developer team since till now I think the attention to detail is immense in developing the software.

Anyhow, when I was setting up my CORS settings I think I did enter `*rigpl.com` in settings and applied the settings which has caused my instance to crash.

Now I think the developers should disallow such fields to be updated into the database and hence I think its a bug atleast for a newbie like me. I am also enclosing the logs below which definitely show that the error is due to the \*[rigpl.com](http://rigpl.com) entry in the configuration.

Now since I cannot access the site from browser, I would like to know where can I remove this entry.

These errors are showing in the log:

```auto
[2020-05-22 10:44:05] mautic.ERROR: Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Untrusted Host "ma.rigpl.com" - in file /var/www/mautic/vendor/symfony/http-kernel/EventListener/RouterListener.php - at line 120 [] []
[2020-05-22 16:14:06] mautic.WARNING: PHP Warning - preg_match(): Compilation failed: nothing to repeat at offset 0 - in file /var/www/mautic/app/bootstrap.php.cache - at line 945 {"host":"ma.rigpl.com","pattern":"{*rigpl.com}i"} []
[2020-05-22 16:14:06] mautic.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\BadRequestHttpException: "Untrusted Host "ma.rigpl.com"" at /var/www/mautic/vendor/symfony/http-kernel/EventListener/RouterListener.php line 120 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException(code: 0): Untrusted Host \"ma.rigpl.com\" at /var/www/mautic/vendor/symfony/http-kernel/EventListener/RouterListener.php:120, UnexpectedValueException(code: 0): Untrusted Host \"ma.rigpl.com\" at /var/www/mautic/app/bootstrap.php.cache:950)"} []
[2020-05-22 16:14:06] mautic.WARNING: PHP Warning - preg_match(): Compilation failed: nothing to repeat at offset 0 - in file /var/www/mautic/app/bootstrap.php.cache - at line 945 {"host":"ma.rigpl.com","pattern":"{*rigpl.com}i"} []
[2020-05-22 16:14:06] mautic.WARNING: PHP Warning - preg_match(): Compilation failed: nothing to repeat at offset 0 - in file /var/www/mautic/app/bootstrap.php.cache - at line 945 {"host":"ma.rigpl.com","pattern":"{*rigpl.com}i"} []
[2020-05-22 16:14:06] mautic.ERROR: Exception thrown when handling an exception (Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Untrusted Host "ma.rigpl.com" at /var/www/mautic/vendor/symfony/http-kernel/EventListener/RouterListener.php line 120) {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException(code: 0): Untrusted Host \"ma.rigpl.com\" at /var/www/mautic/vendor/symfony/http-kernel/EventListener/RouterListener.php:120, UnexpectedValueException(code: 0): Untrusted Host \"ma.rigpl.com\" at /var/www/mautic/app/bootstrap.php.cache:950)"} []
[2020-05-22 16:14:06] mautic.ERROR: Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Untrusted Host "ma.rigpl.com" - in file /var/www/mautic/vendor/symfony/http-kernel/EventListener/RouterListener.php - at line 120 [] []
[2020-05-22 10:46:11] mautic.WARNING: PHP Warning - preg_match(): Compilation failed: nothing to repeat at offset 0 - in file /var/www/mautic/app/bootstrap.php.cache - at line 945 {"host":"ma.rigpl.com","pattern":"{*rigpl.com}i"} []
[2020-05-22 10:46:11] mautic.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\BadRequestHttpException: "Untrusted Host "ma.rigpl.com"" at /var/www/mautic/vendor/symfony/http-kernel/EventListener/RouterListener.php line 120 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException(code: 0): Untrusted Host \"ma.rigpl.com\" at /var/www/mautic/vendor/symfony/http-kernel/EventListener/RouterListener.php:120, UnexpectedValueException(code: 0): Untrusted Host \"ma.rigpl.com\" at /var/www/mautic/app/bootstrap.php.cache:950)"} []
[2020-05-22 10:46:11] mautic.WARNING: PHP Warning - preg_match(): Compilation failed: nothing to repeat at offset 0 - in file /var/www/mautic/app/bootstrap.php.cache - at line 945 {"host":"ma.rigpl.com","pattern":"{*rigpl.com}i"} []
[2020-05-22 10:46:11] mautic.WARNING: PHP Warning - preg_match(): Compilation failed: nothing to repeat at offset 0 - in file /var/www/mautic/app/bootstrap.php.cache - at line 945 {"host":"ma.rigpl.com","pattern":"{*rigpl.com}i"} []
[2020-05-22 10:46:11] mautic.ERROR: Exception thrown when handling an exception (Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Untrusted Host "ma.rigpl.com" at /var/www/mautic/vendor/symfony/http-kernel/EventListener/RouterListener.php line 120) {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException(code: 0): Untrusted Host \"ma.rigpl.com\" at /var/www/mautic/vendor/symfony/http-kernel/EventListener/RouterListener.php:120, UnexpectedValueException(code: 0): Untrusted Host \"ma.rigpl.com\" at /var/www/mautic/app/bootstrap.php.cache:950)"} []
[2020-05-22 10:46:11] mautic.ERROR: Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Untrusted Host "ma.rigpl.com" - in file /var/www/mautic/vendor/symfony/http-kernel/EventListener/RouterListener.php - at line 120 [] []

```

Steps I have tried to fix the problem: I need to know the steps to resolve this error.

---

<div class="post-metadata">

### Author: ![adityaduggal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/adityaduggal/32/2467_2.png) [@adityaduggal](https://forum.mautic.org/u/adityaduggal)
#### Post date: [May 22, 2020, 11:33am UTC](https://forum.mautic.org/t/mautic-failed-after-updating-cors-settings/14450/2 "2020-05-22T11:33:10Z")

</div>

[Github Issue#2355](https://github.com/mautic/mautic/issues/2355) Resolved this issue but I still strongly think that issue being closed should be revived since it basically locks out the users from the server.

The issue is resolved though.

---

<div class="post-metadata">

### Author: ![autoize](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/autoize/32/105_2.png) [@autoize](https://forum.mautic.org/u/autoize)
#### Post date: [May 24, 2020, 12:08am UTC](https://forum.mautic.org/t/mautic-failed-after-updating-cors-settings/14450/3 "2020-05-24T00:08:39Z")

</div>

This is by design, and Trusted Hosts is different than the allowed domains in the CORS Settings further down the page in Configuration \> Basic Settings.

To limit which domains are allowed to embed the tracking pixel, all the domains and subdomains to be tracked (http and https, non-www and www) should be included in CORS settings. The Trusted Hosts is related to where Mautic is running behind a proxy such as a Load Balancer, which is not the case for most users.

Mautic _should_ lock users out when the incorrect setting is entered in Trusted Hosts, as its a security setting. That’s why the Github issue was closed because the “problem” is due to user error, even though the documentation could probably be improved.
