Welcome! Log In Create A New Profile

Advanced

Re: forward requests by IP

michal krajcirovic
June 15, 2009 06:52AM
Igor Sysoev napsal(a):
> On Mon, Jun 15, 2009 at 12:04:44PM +0200, michal krajcirovic wrote:
>
>
>> Hello,
>> trying to resolve some relatively simple problem. We have a webserver,
>> it works NGINX. All the requirements that come with either sent from
>> this site, or (as have the flv and mp4) to send to another server and
>> send it from this second server
>> To use this simple rule in nginx.conf:
>>
>> if (!-e $request_filename) {
>> rewrite ^(.*)flv$ http://second-server.cz$1flv;
>> rewrite ^(.*)mp4$ http://second-server.cz$1mp4;
>> }
>>
>> New but need to be directed only to the requirements of this from some
>> IP ranges (which is about 5000) and everything outside these ranges are
>> odbavovalo directly from this server.
>> (the local node in the Czech Republic where the link is cheap providers
>> from one datacenter, and external flow is cheap from the second
>> datacenter).
>>
>> Is there a simple solution to this problem?
>>
>
> I'm not understand your problem completely, should it be redirect
> or proxying ? Probably you need somethign like this:
>
> geo $czech {
> default 0;
> 192.168.1.1/24 1;
> ...
> }
>
> location ~ \.(flv|mp4)$ {
> error_page 404 = @ext
> }
>
> location @ext {
> if ($czech) {
> rewrite ^ http://second-server.cz$request_uri;
> }
> # what's here ?
> }
>
>
>

Hello,
thanks for the reply. Try to describe better :-)

I have a server to me coming requests. This server is responsible to
them, but all requests *.flv and *.mp4 is resend to Server2 by rule (i
send it in previous mail).
I want: if the request comes from a different IP than in the list (list
includes the Czech IP), immediately responded to a request and not
sending it to Server2.

It would use the GeoIP, but I have nginx directly from the debian
package does not need to be re-compiled with GeoIP?

Thanks a lot.
Subject Author Posted

forward requests by IP

michal krajcirovic June 15, 2009 06:04AM

Re: forward requests by IP

Igor Sysoev June 15, 2009 06:13AM

Re: forward requests by IP

michal krajcirovic June 15, 2009 06:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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