Update for wokring with nginx and fix some test