网络技术 阿里云项目部署

【转】阿里云oss错误:Forbidden access to the original image

好长时间没看网站了,今天突然发现了一个问题就是所有的图片都看不到了。如图:

遇到这种问题的时候,不要慌,因为oss涉及了多层通讯,需要先排查问题。我先看了一下http状态码。我用的是chrome浏览器,按Ctrl+Shift+i调出控制台,点击network,展示如下图,可以看到图片文件是403,也就是说这个文件还在,地址也正确,但是访问这个地址请求不到这个资源,那就是被禁止了。这样一来,原因就能通过一个状态码来分析出来,排查的范围就大大缩小了。

首先,php.ini、nginx.conf包括mysql那边我都没改过。这个问题出现的也是非常突然。那么我觉得问题就在阿里云oss的配置上,oss的配置有站内和站外,站内就是WordPress的插件,站外就是阿里云oss的控制台。我先打开了WordPress的插件,验证了AccessKey信息正确,域名正确,路径正确,ssl正确,oss也没用cdn。网站上是从没改过的,这就可以排除oss插件配置是正常的。

 

我在新窗口中打开了状态码为的403图片

在message中看到了一句[Forbidden access to the original image],不用一个词一个词的解释了,这句话意思是禁止访问原始图像。原始图像(original image),我记得oss控制台里面有这个选项近似的意思,果然找到了。正确的步骤如下

  1. 登陆阿里云oss控制台https://oss.console.aliyun.com
  2. 选择bucket
  3. 图片处理
  4. 访问设置
  5. 关闭原图保护
  6. 回到站内Ctrl+F5刷新,或Ctrl+Shift+i打开Network勾选Disable Cache刷新。

5 thoughts on “【转】阿里云oss错误:Forbidden access to the original image

  1. I think that what you said made a great deal of sense.
    But, what about this? suppose you wrote a catchier post title?
    I am not saying your information isn’t solid, however what if
    you added something that grabbed folk’s attention? I mean 【转】阿里云oss错误:Forbidden access to the
    original image – 时间爱人 is a little vanilla.

    You should look at Yahoo’s front page and watch how they write article headlines to grab viewers to click.
    You might try adding a video or a picture or two to get
    readers excited about everything’ve written. Just my opinion, it might bring your
    posts a little bit more interesting.

    Check out my web site :: download (Mohammed)

  2. I think everything composed was very reasonable.
    However, consider this, what if you were to create a awesome post title?
    I mean, I don’t wish to tell you how to run your website, but what if you added a headline that grabbed folk’s attention? I
    mean 【转】阿里云oss错误:Forbidden access to the original image – 时间爱人 is kinda vanilla.

    You should look at Yahoo’s home page and note how they
    create post headlines to get viewers interested.
    You might add a related video or a picture or two to grab people interested
    about everything’ve written. In my opinion, it might bring your posts a little
    bit more interesting.

    my web page :: ebook (Tamie)

  3. I think everything wrote was very reasonable. However,
    consider this, suppose you wrote a catchier title?
    I am not suggesting your content is not good., but suppose you added a post title
    that grabbed a person’s attention? I mean 【转】阿里云oss错误:Forbidden access to
    the original image – 时间爱人 is kinda boring. You ought to peek at Yahoo’s front page and watch how they create news headlines to get viewers to click.

    You might add a related video or a related pic or two to get
    readers interested about everything’ve got to say. Just my
    opinion, it might bring your blog a little livelier.

    Feel free to surf to my website :: book (beerwindow75.mystrikingly.com)

  4. I think everything typed made a great deal of
    sense. However, think about this, suppose you added
    a little content? I am not suggesting your content isn’t solid, however
    what if you added a title to possibly grab folk’s attention? I
    mean 【转】阿里云oss错误:Forbidden access to the original image – 时间爱人 is a little boring.
    You should glance at Yahoo’s front page and watch how they write post headlines to get people to click.
    You might try adding a video or a pic or two to
    grab readers excited about what you’ve got to say. Just my opinion,
    it could make your website a little bit more interesting.

    my site: question (ecuadortenisclub.com)

  5. 总感觉有些功能不知道是不成熟还是什么原因,用了就会有各种问题。CDN中也有些功能用了就会出问题。阿里云这个OSS的原图保护应该还是比较给力的,就是不知道为什么会有问题

发表评论

电子邮件地址不会被公开。 必填项已用*标注

返回顶部