Forum

Laravel and ProxyPa...
 
Notifications
Clear all

Laravel and ProxyPass/ProxyPassReverse base URL fix

2 Posty
1 Users
0 Reactions
1,478 Widok
0
Topic starter

how to fix base url? indead of local hostname

2 Answers
0
Topic starter

1. edit /routes/api.php
2. add

1
2
3
4
5
6
7
8
9
10
$proxy_url    = getenv('PROXY_URL');
$proxy_schema = getenv('PROXY_SCHEMA');
 
if (!empty($proxy_url)) {
    URL::forceRootUrl($proxy_url);
}
 
if (!empty($proxy_schema)) {
    URL::forceSchema($proxy_schema);
}
$proxy_url    = getenv('PROXY_URL');
$proxy_schema = getenv('PROXY_SCHEMA');

if (!empty($proxy_url)) {
	URL::forceRootUrl($proxy_url);
}

if (!empty($proxy_schema)) {
	URL::forceSchema($proxy_schema);
}

3. edit .env file
4. put

1
2
PROXY_URL = http://internet.address.com
PROXY_SCHEMA = http
PROXY_URL =  http://internet.address.com 
PROXY_SCHEMA = http
0
Topic starter

WARNING!: this solution is not working for /login methon od auth controller.

WORKAROUND: try to change ProxyPass url from my.service.local to my.service.com and modify /ets/hosts file of those two servers to point that my.service.com to local ip address of internal server

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: