# Default domain name

**URL:** <https://www.ruby-forum.com/t/default-domain-name/227846>\
**Category:** NGINX\
**Created:** [March 30, 2013, 6:17pm UTC](https://www.ruby-forum.com/t/default-domain-name/227846 "2013-03-30T18:17:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![esujit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/cc9497/32.png) [@esujit](https://www.ruby-forum.com/u/esujit)\
**Post date:** [March 30, 2013, 6:17pm UTC](https://www.ruby-forum.com/t/default-domain-name/227846/1 "2013-03-30T18:17:34Z")

</div>

I am trying out the proxy (without cache module) functionality in nginx.

Here is the problem I am encountering  
On the client machine the default domain name is [company.com](http://company.com)  
when user types in [http://department](http://department) in the browser, the DNS resolves to  
[department.company.com](http://department.company.com)  
When this http request gets intercepted by the nginx proxy, it is not  
able  
to process the request. It gives an error “cannot resolve department”

tcpdump trace showed that the http request has the HOST header without  
the  
domain name.  
HOST: department

Is there any way we can specify a default domain name in nginx config.

From further investigating found that the server\_name directive matches  
the  
HOST header. Is there any rewrite regex we could use  
such that IF the HOST header has a value without domain name THEN add  
the  
default domain name.

Posted at Nginx Forum:

> **[default domain name](https://forum.nginx.org/read.php?2,237982,237982#msg-237982)**
>
> I am trying out the proxy (without cache module) functionality in nginx. Here is the problem I am encountering On the client machine the default domain name is company.com when user types in http://department in the browser, the DNS resolves to...
