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!