我使用elasticbeanstalk的Laravel API和ec2的nextjs前端。问题在于授权头。来自localhost的授权头工作正常。但从ec2服务器授权头没有附加。Nginx运行在elasticeanstalk上。有什么解决办法吗?
本地主机头:
{
"accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
"accept-encoding": "gzip, deflate",
"referer": "http://localhost:81/",
"origin": "http://localhost:81",
"accept": "application/json",
"content-type": "application/json",
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36",
"authorization": "********",
"content-length": "2",
"x-amzn-trace-id": "Root=1-614715cb-7ef961995cc73ed53edefc56",
"host": "***.us-east-*.elasticbeanstalk.com",
"x-forwarded-port": "80",
"x-forwarded-proto": "http",
"x-forwarded-for": "xxx.xxx.xxx.xxx"
}
EC2服务器头信息:
{
"accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
"accept-encoding": "gzip, deflate",
"referer": "http://xx.xxx.xx.xxx/",
"origin": "http://xx.xxx.xx.xxx",
"accept": "application/json",
"content-type": "application/json",
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36",
"content-length": "2",
"x-amzn-trace-id": "Root=1-614715b1-75a69852485b4edc517a4057",
"host": "***.us-east-*.elasticbeanstalk.com",
"x-forwarded-port": "80",
"x-forwarded-proto": "http",
"x-forwarded-for": "xxx.xxx.xxx.xxx"
}