O
O
Oleg Voitenko2017-01-25 17:26:23
Nginx
Oleg Voitenko, 2017-01-25 17:26:23

How to organize a stub using nginx?

Help with advice, help implement this thing:
1. The client visits www.site.com/wp-admin
2. NGINX gives him a page with captcha if there is no value in the cookies, for example, sess_cookie 34c34ce6fwev
3. If there is a value in the cookies, then this page is simply redirects it to the live page /wp-admin/
4. If there is no value, then a page with a captcha is generated and after a successful captcha entry, such a cookie is entered into the browser.
It is clear that checking for cookies is a simple php code with a condition.
The question is, how to write in the nginx config to display a page, for example, from /var/www/captha/captha.php instead of what is needed, which will perform the check.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fixid, 2017-01-25
@Fixid

if ($http_cookie !~* 'p=fgdfgdfgdfgdfg' ) {
rewrite ^ test.com/administrator/admin;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question