I'm migrating my application to a new host. I'm now facing a problem wit the url's. For example when I visit www.mydomain.be/public/dashboard the app redirects to myservername.azurewebsites.net/public/dashboard.
A collegue pointed me at the "Laravel routes behind reverse proxy" but this is not working for me. I googled and tried the following:
In Middleware\TrustProxies.php
protected $proxies = [
'**'
];
in .env
PROXY_URL = http://www.mydomain.be/public/
PROXY_SCHEMA = https
in routes/web.phpp
$proxy_url = getenv('PROXY_URL');
$proxy_schema = getenv('PROXY_SCHEMA');
if (!empty($proxy_url)) {
URL::forceRootUrl($proxy_url);
}
if (!empty($proxy_schema)) {
URL::forceScheme($proxy_schema);
}
I also tried in routes/web.php with
URL::forceRootUrl('https://www.mydomain.be/public');
but nothing is fixing the fact that in the url-balk myservername.azurewebsites.net/public/ is shown.