Welcome! Log In Create A New Profile

Advanced

Re: Serve different pages for different IP

December 24, 2014 10:16AM
Thank you.

My configurations were:

1.

root /path_to_root1;

if ($remote_addr = xx.xx.xx.xx) {

set $document_root /path_to root2;
}


2.

map $remote_addr $document_root {

default /path_to_root1;

xx.xx.xx.xx /path_to root2;

}


3.

geo $document_root {

default /path_to_root1;
xx.xx.xx.xx /path_to_root2;
}



I tryed the three ways you suggested but nginx always answered:

nginx: [emerg] the duplicate "document_root" variable.


My configuration would be to have one document_root for a specific IP and another for the rest of the world.

Did i make any mistake in my configuration?

thank you
Subject Author Posted

Serve different pages for different IP

magal December 23, 2014 05:58AM

Re: Serve different pages for different IP

Francis Daly December 23, 2014 08:18AM

Re: Serve different pages for different IP

magal December 24, 2014 10:16AM

Re: Serve different pages for different IP

Francis Daly December 24, 2014 10:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 89
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready