我想通了-您需要重写该
pre_request钩子。
可以按照以下步骤进行:
您需要创建一个配置文件,例如
config/gunicorn.py:
def pre_request(worker, req): if req.path == '/healthcheck': return worker.log.debug("%s %s" % (req.method, req.path))然后,在您启动gunicorn时使用它:
gunicorn server:app -c config/gunicorn.py



