copy more code from nginx