reroute() does not like urls with port (like localhost:8000)

54 views
Skip to first unread message

Alexandre Plennevaux

unread,
Feb 27, 2018, 11:02:08 AM2/27/18
to Fat-Free Framework
I have this strange behaviour in a local development environment, which uses the URL http://localhost:8000 as a basis.

The application and its routes behaves just fine, except for the reroute() method.

Here is the code of the offending line :

``` 
$f3->reroute('@startup(@promoid=5)');

````


The incriminated line appears in a beforeRoute() handler:

namespace Controller;


class Startup
{
   
public function beforeRoute(\Base $f3, $params)
         
{


 $current_promo
= $f3->get('COOKIE.current_promo');

 
// this returns correctly : /startups/5
 
// die($f3->alias('startup', 'promoid='.$current_promo));

 $f3
->reroute('@startup(@promoid='.$current_promo.')');
       
}
}



Am I doing something wrong ? 


Alexandre Plennevaux

unread,
Feb 27, 2018, 11:07:33 AM2/27/18
to f3-fra...@googlegroups.com
mmh I got the explanation : I'm working on a docker environment, where the host's port 8000 is mapped to port 80 in the guest machine.

If I do this:

 die( "port: ". $f3->PORT );


it outputs:

port: 80 

I guess I'll need to solve that at the nginx level.

Emmanuel Simond

unread,
Mar 15, 2018, 9:25:35 AM3/15/18
to Fat-Free Framework
>> I guess I'll need to solve that at the nginx level.


was it the issue ? 

Emmanuel

unread,
Apr 2, 2018, 8:51:57 AM4/2/18
to Fat-Free Framework
solved ?

Alexandre Plennevaux

unread,
Apr 2, 2018, 10:01:01 AM4/2/18
to Fat-Free Framework
yes, by using port 8000 instead of 80 in the docker container. 

On Monday, April 2, 2018 at 2:51:57 PM UTC+2, Emmanuel wrote:
solved ?
Reply all
Reply to author
Forward
0 new messages