我试图让Cloudflare充当S3上托管文件的CDN,这样任何人都无法直接访问这些文件.例如:
S3桶: cdn.mydomain.com.s3.amazonaws.com
CDN(Cloudflare): cdn.mydomain.com
我想要的是能够访问cdn.mydomain.com/file.jpg(Cloudflare)但不能访问cdn.mydomain.com.s3.amazonaws.com/file.jpg(S3).
现在我在Cloudflare上配置了一个指向我的存储桶的CNAME,以及以下CORS:
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authorization</AllowedHeader>
</CORSRule>
</CORSConfiguration>
Run Code Online (Sandbox Code Playgroud)
如果我尝试通过S3或CDN访问任何文件,我将被拒绝.如果我公开一个文件(也就是被授予的每个人),我可以通过S3和CDN访问该文件.
我曾试图改变AllowedOrigin用*.mydomain.com,但没有运气.
我对注释中的丰富代码段有以下代码:
<ul itemscope itemtype="http://schema.org/UserComments">
<li id="comment-1" class="comment">
<span itemprop="name" class="author">Author 1</span>
<p itemprop="commentText">Bla Bla Bla</p>
<time itemprop="commentTime" content="2012-07-29" datetime="2012-07-29T05:55+00:00" title="Jul 29, 2012 5:55">2 days ago</time>
</li>
<li id="comment-2" class="comment">
<span itemprop="name" class="author">Author 2</span>
<p itemprop="commentText">yada yada yada</p>
<time itemprop="commentTime" content="2012-07-30" datetime="2012-07-30T04:44+00:00" title="Jul 30, 2012 4:44">yesterday</time>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
根据schema.org/UserComments,这是正确的.但是,谷歌的Rich Snippets测试工具正在发出警告:
警告:缺少必填字段"dtstart".
dtstart甚至不是UserComments事件的属性.我应该忽略这个警告(谷歌的工具是测试版)吗?或者我错过了什么?
什么是正确的?
<a>
<time>TIME_HERE</time>
</a>
Run Code Online (Sandbox Code Playgroud)
要么
<time>
<a>TIME_HERE</a>
</time>
Run Code Online (Sandbox Code Playgroud)
或者以上都不是有效的.
有什么方法可以使用 AWS 命令行将本地文件夹与包含句点“.”的存储桶同步?
如果我这样做:
aws s3 sync local_folder/ s3://files.domain.com/backup
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
致命错误:名为 files.domain.com 的存储桶与 DNS 不兼容。不能使用虚拟托管式寻址。可以通过在 AWS Config 文件或 botocore.client.Config 对象中删除addressing_style 值或将该值设置为“path”或“auto”来配置寻址样式。
我已经尝试删除或更改addressing_styleAWS 配置中的值,但没有奏效。我不知道如何在 botocore 上进行更改。
AWS 配置
[default]
output = json
region = us-west-1
s3 =
max_concurrent_requests = 100
max_queue_size = 10000
multipart_threshold = 64MB
multipart_chunksize = 16MB
use_accelerate_endpoint = true
Run Code Online (Sandbox Code Playgroud) 我已经通过将源视频转换为 GIF 来完成此工作:
ffmpeg -y -t 5 source.mp4 -vf fps=10,scale=480:-1,smartblur=ls=-0.5,crop=iw:ih-2:0:0 -hide_banner -loglevel panic output.gif
Run Code Online (Sandbox Code Playgroud)
然后将 GIF 转换为 MP4,如下所示:
ffmpeg -y animated.gif -hide_banner -pix_fmt yuvj420p -loglevel panic -an -loglevel panic final.mp4
Run Code Online (Sandbox Code Playgroud)
我想要的是直接转换source.mp4为final.mp4,并具有与普通 GIF 相同的 256 调色板。
我尝试将这两个命令合并在一起,虽然它生成了 MP4,但结果是 16 位视频,比 8 位视频小得多。
我是否需要先生成调色板palettegen,然后用该调色板重新编码视频?
amazon-s3 ×2
html5 ×2
botocore ×1
cloudflare ×1
cors ×1
ffmpeg ×1
html ×1
microdata ×1
schema.org ×1