Where do I put “WSGIPassAuthorization On”?

懵懂的女人 提交于 2019-12-18 03:57:41

问题


I'm trying to see the Authorization header in Django, using mod_wsgi. I read that Apache holds back the Authorization header by default, I've put << WSGIPassAuthorization On >> in my Apache VirtualHost block and . . . nada.

How do I figure out where to put this?


回答1:


Put it at same place as WSGIScriptAlias and it should work fine.




回答2:


Connect to your EC2, go to etc/httpd/conf.d folder and open wsgi.conf file. Insert the code within VirtualHost DOM:

WSGIPassAuthorization On

RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]


来源:https://stackoverflow.com/questions/9780966/where-do-i-put-wsgipassauthorization-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!