Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1585

Is there any solution in regard to inaccessible forwarding URL (https) ngrok provided? I can only access http runned by laravel

$
0
0

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:

enter image description hereenter image description here

I have tried applying all resolutions provided in stack overflow but nothing seems to be working.


Viewing all articles
Browse latest Browse all 1585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>