Jarv/nginx refactor