ffix errors and test db
fix nginx config