apache2+django 请求头中Authorization信息丢失

只需要在 apache 的配置文件中加入 WSGIPassAuthorization On 即可

配置如下:

LoadFile "d:/python/python36.dll"
LoadModule wsgi_module "d:/python/lib/site-packages/mod_wsgi/server/mod_wsgi.cp36-win_amd64.pyd"
WSGIPythonHome "d:/python"

#设置工程中的wsgi路径
WSGIScriptAlias / d:\django\gateServer\gateServer\wsgi.py
#设置工程路径
WSGIPythonPath d:\django\gateServer

WSGIPassAuthorization On                    # 关键:可以获取 authorization 
#设置wsgi路径

    
        Require all granted
    

#设置静态文件路径
Alias /static D:\django\gateServer\templates\static
  
    AllowOverride None  
    Options None  
    Require all granted  

 

你可能感兴趣的:(Django)