Welcome! Log In Create A New Profile

Advanced

testcookie and recaptcha

Posted by mspirko 
testcookie and recaptcha
September 26, 2013 11:04AM
Hi,

I'm trying to configure testcookie with recaptcha on nginx for some time now. I added recapcha page and tried to use folowing example with no luck:

server {
listen 80;
server_name domain.com;

testcookie off;
testcookie_name BPC;
testcookie_secret keepmescret;
testcookie_session $remote_addr;
testcookie_arg attempt;
testcookie_max_attempts 3;
testcookie_fallback /cookies.html?backurl=http://$host$request_uri;
testcookie_get_only on;
testcookie_redirect_via_refresh on;
testcookie_refresh_template '<html><body><script>document.cookie="BPC=$testcookie_set";document.location.href="$testcookie_nexturl";</script></body></html>';

location = /cookies.html {
root /var/www/public_html;
}


location / {
testcookie on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:8080;
}
}

I would like to point every new visitor to recaptcha page and set cookie and pass through every visitor that have a cookie to site backend.

I will appreciate any help that I can get.

Thank you!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 169
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready