我通过axios请求s3服务器,我也得到了Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.,在那之前,我得到了OPTIONS https://s3.ap-northeast-2.amazonaws.com/.../... 403 (Forbidden)
我应该在客户端解决这个问题.我在我的本地机器上托管我的文件.我的请求代码如下.
axios({
url: 'https://s3.ap-northeast-2.amazonaws.com/.../...',
method: 'get',
withCredentials: true,
headers: {
'Content-Type': 'image/jpeg',
'Access-Control-Allow-Origin': 'http://*, https://*',
}
Run Code Online (Sandbox Code Playgroud)
})
我试过了
start chrome --disable-web-security 用git没有用......我怎么解决这个问题?
创建运行 Ubuntu 的 AWS EC2 实例后,我使用 Putty 启动了 ubuntu。然后我使用以下命令安装了 Nginx:
sudo apt-get udpate之后
sudo apt-get install nginx
,为了检查 Nginx 是否正常工作,我在浏览器中输入了 IP 地址,但出现ERR_CONNECTION_TIMED_OUT错误。为什么 Nginx 不工作?我只关注了https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-16-04。我不知道为什么它不起作用。