RE: how to create session persistence or hash_ip within server context for an if statement

2022-01-24 Thread Reinis Rozitis
> I got it working! I am not sure of the performance hit, maybe someone know how to make this more effective? Without going deeper on what are your actual requirements and what is the expected result, the suggestion I could give is instead of the multiple if statements to look at the map directiv

Re: how to create session persistence or hash_ip within server context for an if statement

2022-01-24 Thread Jelle de Jong
On 1/24/22 11:15, Reinis Rozitis wrote: I want to be able to do an redirect, but only one time, the hit it should not redirect. If a client visits an web-store it will get redirected to the region specific store, but if then then manually select an other store there it should not redirect bac

RE: how to create session persistence or hash_ip within server context for an if statement

2022-01-24 Thread Reinis Rozitis
> I want to be able to do an redirect, but only one time, the hit it should not redirect. > > If a client visits an web-store it will get redirected to the region specific store, but if then then manually select an other store there it should not redirect back again. I don't know if a nginx sessio

Re: how to create session persistence or hash_ip within server context for an if statement

2022-01-24 Thread Jelle de Jong
Thank you for taking a look! On 1/24/22 00:45, Francis Daly wrote: On Fri, Jan 21, 2022 at 12:45:16PM +0100, Jelle de Jong wrote: Hi there, How can I use an nginx session or hash_ip in the server context to only do the following if statement code once and not a second time an client visits th

Re: how to create session persistence or hash_ip within server context for an if statement

2022-01-23 Thread Francis Daly
On Fri, Jan 21, 2022 at 12:45:16PM +0100, Jelle de Jong wrote: Hi there, > How can I use an nginx session or hash_ip in the server context to only do > the following if statement code once and not a second time an client visits > the website: > > server { > if ($geoip2_data_country_iso_code

how to create session persistence or hash_ip within server context for an if statement

2022-01-21 Thread Jelle de Jong
Hello everybody, How can I use an nginx session or hash_ip in the server context to only do the following if statement code once and not a second time an client visits the website: server { if ($geoip2_data_country_iso_code != GB) { return 302 https://test01.example.nl$request_uri