title: Symfony2: Routing ignores port in URL
body: <p>I'm trying to run a Symfony2 based web app under port 8080 instead of port 80. Now I've noticed that all absolute routes lack the port sepcification in the URL. This is also true for redirects, which try to redirect to port 80 as well.
  Also, when using url('') in the twig templates, no port is included.</p>
  
  <p>What I've tried up to now is setting the framework.router.http_port setting, which didn't do anything. Then I tried to manually create a RequestContext and pass it to the router during bundle bootup, also to no avail. This is the code I've tried:</p>
  
  <pre><code>$router = $this-&gt;container-&gt;get('router');
  if (!empty($_SERVER['HTTP_HOST'])) {
      list($host, $port) = explode(':', $_SERVER['HTTP_HOST']);
  
      $context = new RequestContext(
              '',
              $_SERVER['REQUEST_METHOD'],
              $host,
              (empty($_SERVER['HTTPS'])?'http':'https'),
              $port
      );
      $router-&gt;setContext($context);
  }
  </code></pre>