Используйте любую систему контроля (Кактусы, Zabbix, Munin...) для контроля использования памяти демона.
did you read if is evil?
it still returns only JSON without the wrapper.
what is the wrapper here for you? the first/the second if or both?
EDIT:
i'd do simple debugging to test, if your regex is valid (increase log-level to see whats happening)(solution is untested)
server {
listen 80;
server_name api.example.com;
location /api/ {
rewrite ^/(.*)callback=[^&]*(.*)$ /testurl/$1/$2 last;
}
location /testurl {
return 200;
}
}
after this step i'd put in the 2nd IF - statement, and if that works, the first one finally
how does your url looks like with that callback-parameters?