What if I am using a reverse proxy?
This should be used with a load balancer terminates TLS / SSL certificates. This is often because your application is being forwarded traffic from your load balancer on port 80 and does not know it should generate secure links.
To implement load balancing within FusionInvoice:
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var string|array
*/
protected $proxies = [
'192.168.1.1',
'192.168.1.2',
];
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO;
}
Note the 192.x.x.x addresses should be replaced with your load balancer IP address(es)
If you are using a cloud load balancer, you may not know the IP addresses of your actual balancers. In this case, you may use * to trust all proxies:
/**
* The trusted proxies for this application.
*
* @var string|array
*/
protected $proxies = '*';