how to handle "server_name" in intranet environment

Igor Sysoev is at
Thu Sep 6 23:42:40 MSD 2007

On Thu, Sep 06, 2007 at 07:27:48PM +0000, Bert Douglas wrote:

> I am planning to make an application server appliance (computer in small box
> with no keyboard,display, or mouse).
> This is plugged into intranet with fixed private IP address.
> Clients will access by entering IP address into browser.
> Nginx is used as front end on the appliance.
> What should I put in for "server_name"?
> Sometimes I see problem when using a "location" directive like "location /abc/".
> If the client enters URL like this:   "http://192.168.x.x/abc" instead of
> http://192.168.x.x/abc/", that is user leaves off the trailing "/", then the
> browser is redirected to "http://localhost/abc/" , which doesn't work.
> Can I disable this redirection in the general case?

How do you want to process http://192.168.x.x/abc ?

> What do I have to do to avoid triggering the redirection?

      server_name  _ *;

the "_" is stub, and "*" says nginx to use client "Host" header.

Igor Sysoev

More information about the nginx mailing list