CSRF Validation Failed

Is there a reason why you have modified the nginx config so much? My next suspect would be proxy_set_header Host $host; not working somehow (incorrect context or placement?)