Closed frugan-dev closed 3 years ago
I think this is a problem out of this middleware, because it receives an Uri with https
scheme and the port 80
(it should be port 443
or scheme http
).
Thanks you, as I imagined.. I try to figure out if it depends on my stack, thanks you!
Hi,
I am using Traefik v2.4.8 in front of my SlimPHP 4 application. Traefik manages HTTPS connections and communicates with Apache in the backend on port 8080.
When I enable your Www Middleware, it redirects by adding port 80 to the url. If I analyze the call at this point https://github.com/middlewares/www/blob/master/src/Www.php#L40 I find that:
If I change this line https://github.com/middlewares/www/blob/master/src/Www.php#L52 from so:
to so:
the problem is apparently solved..
I don't understand if there is a wrong setting in my stack (Traefik + Apache + PHP-FPM), or if it depends on this method https://github.com/slimphp/Slim-Psr7/blob/master/src/Uri.php#L303 which in my case returns 'false'.
Thanks to anyone who can give me a tip..