On Wed, Dec 24, 2014 at 10:16:28AM -0500, magal wrote:
Hi there,
> My configuration would be to have one document_root for a specific IP and
> another for the rest of the world.
In each case, do not set $document_root.
Instead, set $my_root_var (for example). Then separately, do
root $my_roo
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
On Tue, Dec 23, 2014 at 05:58:00AM -0500, magal wrote:
Hi there,
> I have one domain and I want to serve different pages based on the Client
> IP.
>
> Nginx refuse different server with same server_name and both location must
> be / .
>
> Can you help me?
Set a variable based on the client IP
I have one domain and I want to serve different pages based on the Client
IP.
Nginx refuse different server with same server_name and both location must
be / .
Can you help me?
Tnk
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,255744,255744#msg-255744
_