Answer the question
In order to leave comments, you need to log in
Why doesn't the NGINX setup work?
I'm trying to make a stub for the admin sites on the server through the NGINX setup
location ~* /(wp-login\.php|administrator|admin\.php) {
set $humantest 0;
if ($http_cookie !~* "humans=checktest") {
set $humantest 1;
}
if ($args ~* (callback|logout|lostpassword)) {
set $humantest 0;
}
if ($humantest = 1) {
add_header Content-Type text/html;
return 200 "<html><body><script>document.cookie='humans=checktest;path=/';location.reload();</script></body></html>";
}
error_page 404 = @fallback;
}
Answer the question
In order to leave comments, you need to log in
location ~ /(wp-login|admin)\.php {
set $humantest 0;
if ($http_cookie !~* "humans=checktest") {
set $humantest 1;
}
if ($args ~* (callback|logout|lostpassword)) {
set $humantest 0;
}
if ($humantest = 1) {
add_header Content-Type text/html;
return 200 "<html><body><script>document.cookie='humans=checktest;path=/';location.reload();</script></body></html>";
}
error_page 404 = @fallback;
include fastcgi_params;
fastcgi_pass ...
}
location ~ \.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question