Welcome! Log In Create A New Profile

Advanced

Re: rewrite every req to xxx.html unless coming from xxx.xxx.xxx.xxx ?

Maxim Dounin
June 25, 2009 12:39PM
Hello!

On Thu, Jun 25, 2009 at 01:03:24PM +0800, Pahud wrote:

> Hi,
>
> I'd like to rewrite every request to xxx.html unless they are coming from my
> 2 trusted IP addresses. What can I do?
>
> In the mean time, I need to avoid the loop to request the xxx.html.
>
> Any example appreciated.

Something like this should work:

location / {
error_page 403 =200 /xxx.html;

allow 1.2.3.4;
allow 1.2.3.5;
deny all;

...
}

location = /xxx.html {
# an empty location without access checks
}

Maxim Dounin

>
> pahud
Subject Author Posted

rewrite every req to xxx.html unless coming from xxx.xxx.xxx.xxx ?

Pahud June 25, 2009 01:03AM

Re: rewrite every req to xxx.html unless coming from xxx.xxx.xxx.xxx ?

Maxim Dounin June 25, 2009 12:39PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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