Server host www.domain.com not allowed!

After upgrading from OJS 3.3.0.8 to OJS 3.3.0.10 everything passed well. But, now loading the website can be only with https://domain.com/ not via https://www.domain.com/. After loading with the old web address https://www.domain.com/ the webpage received 400 Bad Request and in error log file Server host "www.domain.com not allowed!
Where can I change allow hosts or from which links is it possible to access the site? How do I add that the domain is loaded with www, http, https …?
The most of links which are worked is our of function.
PHP is 7.4

Kind regards,
Lazar

Did you configure the allowed_hosts variable in config.inc.php ? For an example, see in config.TEMPLATE.inc.php. You can specify multiple domains in array.

1 Like

Hi @mpbraendle,

thank you for your fast response and answer. This is exactly what I try to find. In row allowed_hosts = ’ ’ I added all domains that I plan to use and now works very well.

Kind regards,
Lazar

1 Like

Hi! @Lazar_Stosic
Could you show how you added the sites (an example) in the line allow_hosts = ’ ’
I have tried various ways but it seems like I am missing something or making some mistake somewhere.
Thanks!

Hi @David_Alarcon_davidy

it is so simple. In config.inc.php under allowed_hosts insert all variants of your domain. For example, below is an example where domain.com need to be changed with your domain.
allowed_hosts = "["domain.com", "https://www.domain.com", "www.domain.com"

If you still have problem write me your domain and I will back you with full line which you need just to enter.

Regards,
Lazar

2 Likes

@Lazar_Stosic
thank you very much for your answer… now everything works correctly!

1 Like

i entered the required allodwe_hosts as you say,but it does not work

Clear the cash or check it with different browser.
If still does not work write the line which you entered to check.

when i browse by firefox it responds error like

502 Bad Gateway


nginx

What you have in error.log file?

In error log file 400 Bad request

and i change the allowed_hosts file by my domain name

You need to add all version, with http, https, and without that in host allowed. Just one domain is not enough. Write me what you added in that line. In previous posts you can find an example.