避免存储在s3存储桶中的http内容在浏览器中混乱

时间:2019-07-16 05:19:03

标签: amazon-web-services amazon-s3

我已将一组gzip格式的日志文件复制到s3存储桶中,该存储桶使用内容类型“ text / html”和content-encoding作为gzip创建,以便在对象上设置了公共http访问的浏览器中查看。

使用的命令:

aws s3 cp file.gz s3://test-bucket-xyz --acl public-read --cache-control public --content-type "text/plain" --content-encoding "gzip"

这里是指向logfile的链接,当使用浏览器(google-chrome)进行查看时,这些链接都被打乱了。

我想按如下方式查看输出:

---> lscpu:
 Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             2
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 58
Model name:            Intel Xeon E3-12xx v2 (Ivy Bridge, IBRS)
Stepping:              9
CPU MHz:               2499.998
BogoMIPS:              4999.99
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K

从Apache读取时未看到相同的问题。该如何解决?

1 个答案:

答案 0 :(得分:0)

文件的内容是纯文本,而不是HTML。给它提供text/plain的Content-Type,它将在浏览器中按预期显示。

相关问题