my .env file:
APP_NAME=LaravelAPP_ENV=localAPP_DEBUG=trueAPP_URL=http://127.0.0.1
my AppServiceProvider.php:
<?phpnamespace App\Providers;use Illuminate\Support\ServiceProvider;use Illuminate\Support\Facades\URL;use Illuminate\Http\Request;class AppServiceProvider extends ServiceProvider{ /** * Register any application services. */ public function register(): void { // if (env(key: 'APP_ENV') === 'local'&& request()->server(key: 'HTTP_X_FORWARDED_PROTO') === 'https') { // URL::forceScheme(scheme: 'https'); // } } /** * Bootstrap any application services. */ public function boot(\Illuminate\Http\Request $request) { if ($request->server->has('HTTP_X_ORIGINAL_HOST')) { $request->server->set('HTTP_X_FORWARDED_HOST', $request->server->get('HTTP_X_ORIGINAL_HOST')); $request->headers->set('X_FORWARDED_HOST', $request->server->get('HTTP_X_ORIGINAL_HOST')); } if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { $this->app['request']->server->set('HTTPS', true); } }}
trusted all proxies for testing:
$middleware->trustProxies(at: '*');
added proper handling for authorization header:
RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
screenshots:
I have tried applying all resolutions provided in stack overflow but nothing seems to be working.