ngrok not working correctly to test HTTPs

前端 未结 1 1034
花落未央
花落未央 2021-01-14 20:54

I downloaded ngrok so i can test my site for http and https requests (if someone is trying to get in my site specific url and it will be a simple http request, i will deny i

1条回答
  •  梦毁少年i
    2021-01-14 21:12

    Request::secure() relies on $_SERVER['HTTPS']. As the HTTPS is being provided by the proxy, not your webserver, Laravel doesn't know it's being served as HTTPS.

    ngrok does pass the X-Forwarded-Proto header, but Laravel doesn't trust it by default. You can use the trusted proxy middleware to trust it.

    0 讨论(0)
提交回复
热议问题