Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

nginx config question, rules?

$
0
0
This works:
add_header Set-Cookie "EXAMPLE=$SHAIP;Path=/";

This does not work:
if ($http_cookie ~ "EXAMPLE=$SHAIP") {

Why this? How can I get it to work? I want $SHAIP to be checked if exist, basically it will store the cookie if its not set already.

This is what shaip is:
set_sha1 $SHAIP test;

i want it to compare the sha1'd "test" text, if the cookie is set or not.. for some reason i cant put that variable there?

it's a little hard to explain.

if ($http_cookie ~ "EXAMPLE=$SHAIP") {
return 403;
}

How will i do this correctly? basically check if the sha1'd cookie is set.. currently it just checks if that variable is set, instead of the sha1 its elf.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>