Welcome! Log In Create A New Profile

Advanced

Re: Difficulty configuring virtual host

Paul G Webster
March 10, 2012 08:34PM
Works perfectly thank you :)

On Sun, 11 Mar 2012 01:13:49 -0000, Paul G Webster
<opensource@interflective.com> wrote:

> Ahh smart it should work perfectly any way to set the server_name
> dynamically
>
> On Sun, 11 Mar 2012 01:13:38 -0000, António P. P. Almeida
> <appa@perusio.net> wrote:
>
>> On 11 Mar 2012 01h57 CET, opensource@interflective.com wrote:
>>
>>> Ideally doing this:
>>>
>>> if (srcip == 4.4.4.5) {
>>> server_name test1;
>>> root /usr/local/www/4.4.4.5;
>>> } elsif (srcip == 2.2.2.2) {
>>> server_name test2;
>>> root /usr/local/www/2.2.2.2;
>>> }
>>
>> Untested. Using the geo module [1]. At the http level.
>>
>> geo $root_dir {
>> 4.4.4.5 /usr/local/www/4.4.4.5;
>> 2.2.2.2 /usr/local/www/2.2.2.2;
>> }
>>
>> At the server level (vhost).
>>
>> server {
>> server_name test1 test2;
>> root $root_dir;
>> #...
>> }
>>
>> --- appa
>>
>> [1] http://nginx.org/en/docs/http/ngx_http_geo_module.html
>>
>> _______________________________________________
>> nginx mailing list
>> nginx@nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>
>


--


-- Thank you for your time
-- Paul G Webster
-- Checkout Opera M2 @ http://www.opera.com/mail/

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

Difficulty configuring virtual host

Paul G Webster March 10, 2012 07:50PM

Re: Difficulty configuring virtual host

Paul G Webster March 10, 2012 08:00PM

Re: Difficulty configuring virtual host

António P. P. Almeida March 10, 2012 08:14PM

Re: Difficulty configuring virtual host

Paul G Webster March 10, 2012 08:16PM

Re: Difficulty configuring virtual host

Paul G Webster March 10, 2012 08:34PM

Re: Difficulty configuring virtual host

Paul G Webster March 10, 2012 08:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 171
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