使用python的nginx http身份验证

2024-04-29 01:13:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在从Apache2迁移到NGinX,我想通过python脚本进行身份验证。Apache2的工作配置是:


WSGIScriptAlias /hg $SCRIPT_DIR/hgwebdir.wsgi
WSGIPythonPath $SCRIPT_DIR
<Location /hg>
    AuthType Basic
    AuthName "Mercurial"
    AuthBasicProvider wsgi
    WSGIAuthUserScript $SCRIPT_DIR/authentication.py
    Require valid-user
</Location>

nginx中的等效配置是什么?在


Tags: 脚本身份验证wsgibasicdirscriptnginxlocation