Laravel () route returns bare IP address instead of domain

It was not possible to catch this on my local machine, but I noticed that some of my pages returned the bare IP address of my web server instead of the domain name. Example:

route('homepage')sometimes returns 192.XX8.X.2XXor 192.XX8.X.2XX/index.phpor domain.com/index.php. My pages are cached the first time I visit, and there’s a 50% chance that everything will look weird for all the URLs on the page.

Is there an explanation for this strange behavior and how can I fix it? This is pretty dangerous as Googlebot lists three additional duplicates of my sites.

Note. I also use the LaravelLocalization package for my routes: https://github.com/mcamara/laravel-localization

I also run this application under Laravel Forge (Nginx)

+4
source share

All Articles