SERVER_NAME cgi variable

Anna Martynova terrible.broom at gmail.com
Mon Jul 6 11:34:05 UTC 2009


2009/7/6 Denys Vlasenko <vda.linux at googlemail.com>

> On Monday 06 July 2009 10:27, Anna Martynova wrote:
> > Hello.
> > I saw comments in the source, that you recommend to set SERVER_NAME
> variable
> > before starting httpd server. But what to do in the case, when server has
> > several addresses and I need to know, what address the client have
> > requested?
> > For example, Apache web server provides this, variable SERVER_NAME is
> > request-specific.
>
> http://www.zytrax.com/tech/web/env_var.htm:
>
> "SERVER_NAME
>
> The servers host name, DNS alias or IP address. For Apache
> the name appearing on the relevant ServerName directive
> (may be in the general section or a <virtualhost> section e.g."
>
> busybox httpd does not support virtual hosts.
> You need to implement this support in the CGI itself.
>
> > I understand, that busybox httpd is not Apache. :) But
> > could you give some hint, how to get it?
>
> HTTP_HOST is the variable you are looking for.
> It is retrieved from "Host:" header.
>
> --
> vda


You are right, I need HTTP_HOST. Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090706/b2a6786e/attachment.htm>


More information about the busybox mailing list