laravel Redirect::to() loses the port laravel Redirect::to() loses the port nginx nginx

laravel Redirect::to() loses the port


This smells like a bug. I get stuck digging in the UrlGenerator when it looks for the request->root(). From what I can see there is no root() function on the Symfony\Component\HttpFoundation\Request. You could try replacing ->root() with ->getBaseUrl() instead.

Regardless of the outcome, you should prepare a small test case (with as little excess code as possible) and report the issue on GitHub to be fixed. If you can find a solution while you're at it then a pull request can be made to fix the issue.