Welcome! Log In Create A New Profile

Advanced

default domain name

March 30, 2013 01:17PM
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 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.
Subject Author Posted

default domain name

esujit March 30, 2013 01:17PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 274
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready