# Mvc hostname router and port

**URL:** <https://discourse.laminas.dev/t/mvc-hostname-router-and-port/864>\
**Category:** Components & MVC\
**Tags:** zend-mvc\
**Created:** [December 21, 2018, 10:14am UTC](https://discourse.laminas.dev/t/mvc-hostname-router-and-port/864 "2018-12-21T10:14:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rado\_Dr](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/rado_dr/32/422_2.png) [@Rado\_Dr](https://discourse.laminas.dev/u/Rado_Dr)\
**Post date:** [December 21, 2018, 10:14am UTC](https://discourse.laminas.dev/t/mvc-hostname-router-and-port/864/1 "2018-12-21T10:14:43Z")

</div>

Hi,  
I have ZF2 mvc application with hostname router config. Because I want to have several languages separated by 3rd level domain names. In my docker development environment I use non-standard port for web server. And there is a my problem:  
When I use url view helper, I cannot get hostname with current port from request.

How can I use it? Is there anybody with working solution?

Thank you,  
Rado.

---

<div class="post-metadata">

**Author:** ![ocramius](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/ocramius/32/23_2.png) [@ocramius](https://discourse.laminas.dev/u/ocramius)\
**Post date:** [December 27, 2018, 6:00pm UTC](https://discourse.laminas.dev/t/mvc-hostname-router-and-port/864/2 "2018-12-27T18:00:29Z")

</div>

You’d probably need a port router added to the stack.

My suggestion is (for a local dev environment) to have a traefik in front of your servers, and run everything from a single load balancer at a standard port.

I wrote an example of that at [https://gist.github.com/Ocramius/d44b9c500d3fd19e863c621500adeec0](https://gist.github.com/Ocramius/d44b9c500d3fd19e863c621500adeec0)
