Welcome! Log In Create A New Profile

Advanced

Re: Vhost support

January 29, 2011 02:10AM
On Sat, Jan 29, 2011 at 05:04:23PM +1000, Mark Constable wrote:

> So there doesn't seem to be any interest in some kind of
> vhost_alias module so I'd like to try and write one but I
> need a little help with the nginx codebase.
>
> server {
> listen 80;
> server_name _;
> location / {
> root /var/www/$host;
> }
> }
>
> If I use the above then I get this in the logs...
>
> 2011/01/29 16:09:13 [error] 32404#0:
> *1 "/var/www/domain.org/index.html" is not found
> (2: No such file or directory), client: 192.168.1.2,
> server: _, request: "GET / HTTP/1.1", host: "domain.org"
>
> (yes, I know the /var/www/domain.org directory does not exist)
>
> This is pretty good but I want to reverse the domain.org $host
> variable and provide, say, a $rhost variable of "org/domain".
>
> I have an apache2 module that already does this so I just need
> some orientation or assistance to find where in the nginx code
> to do the same thing so any pointers would be appreciated.
>
> Anyone care to offers some clues?

http://nginx.org/en/docs/http/server_names.html#regex_names


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Vhost support

Mark Constable January 29, 2011 02:08AM

Re: Vhost support

Igor Sysoev January 29, 2011 02:10AM

Re: Vhost support

Mark Constable January 29, 2011 02:38AM

Re: Vhost support

Igor Sysoev January 29, 2011 03:04AM

Re: Vhost support

António P. P. Almeida January 29, 2011 03:06AM

Re: Vhost support

António P. P. Almeida January 29, 2011 03:46AM

Re: Vhost support

Mark Constable January 29, 2011 07:40AM

Re: Vhost support

Igor Sysoev January 29, 2011 01:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 144
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready