change pf to json in nginx script