问题
The question above is the thread associated with these links. Link 1, Link 2
It's like this when I understand my current situation.
Request.user cannot be identified from EC2 instance created via AWS EB. The reason is that the Authorization: Bearer {token}
provided during data communication is not being delivered to the EC2 instance.
However, this issue only occurs within AWS instances. With the same code, Authorization data is correctly passed in local, and it is also correctly passed in GCP Compute instance.
I think it's an environmental issue in AWS, but is there something I should look at?
回答1:
So I did some digging in the AWS forums and this does seem to be a known "issue". Looks like there is a a fix:
in .ebextensions/wsgihacks.config:
files:
"/etc/httpd/conf.d/wsgihacks.conf":
mode: "000644"
owner: root
group: root
content: |
WSGIPassAuthorization on
Original thread: https://forums.aws.amazon.com/message.jspa?messageID=376244
来源:https://stackoverflow.com/questions/62686560/is-there-an-aws-inbound-policy-that-interferes-with-authorization-bearer-toke