Apache Cloudfront创建301并更改我的url

Apache Cloudfront创建301并更改我的url,apache,amazon-cloudfront,Apache,Amazon Cloudfront,我已经安装了apache 2.4,其中包含以下规则: RewriteCond %{HTTP_USER_AGENT} !^Amazon\ CloudFront$ [NC] RewriteCond %{REQUEST_FILENAME} "\.(gif|bmp|pdf|zip|avi|mp3|wav|mov|flv|wmv|mp4)$" [NC] RewriteRule /(.*) https://dl2.hexcode.co.za/$1 [R,L] 打击使: 这是现场直播,所

我已经安装了apache 2.4,其中包含以下规则:

RewriteCond %{HTTP_USER_AGENT} !^Amazon\ CloudFront$ [NC]
RewriteCond %{REQUEST_FILENAME} "\.(gif|bmp|pdf|zip|avi|mp3|wav|mov|flv|wmv|mp4)$" [NC]
RewriteRule /(.*) https://dl2.hexcode.co.za/$1 [R,L]
打击使:

这是现场直播,所以如果你点击,你会复制它

奇怪的是url的连接

在我的apache日志中,我看不到CF试图命中

这里是我的规则日志:

init rewrite engine with requested uri /spinner.gif
applying pattern '/(.*)' to uri '/spinner.gif'
rewrite '/spinner.gif' -> 'https://dl2.hexcode.co.za/spinner.gif'
explicitly forcing redirect with https://dl2.hexcode.co.za/spinner.gif
escaping https://dl2.hexcode.co.za/spinner.gif for redirect
redirect to https://dl2.hexcode.co.za/spinner.gif [REDIRECT/302]
init rewrite engine with requested uri /spinner.gif
applying pattern '/(.*)' to uri '/spinner.gif'
rewrite '/spinner.gif' -> 'https://dl2.hexcode.co.za/spinner.gif'
explicitly forcing redirect with https://dl2.hexcode.co.za/spinner.gif
escaping https://dl2.hexcode.co.za/spinner.gif for redirect
redirect to https://dl2.hexcode.co.za/spinner.gif [REDIRECT/302]
这里是我的CF日志:

GET d1e1bt7ihtrs6n.cloudfront.net   /spinner.gif    301 -   Mozilla/5.0%20(X11;%20Linux%20x86_64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/85.0.4183.83%20Safari/537.36  -   -   Hit XwYJzzXlS7NjQTd5VIfoADdirrlhMx103vqgQuSw6xeeCq5ly_5N_A==    dl2.hexcode.co.za   https   401 0.003   -   TLSv1.3 TLS_AES_128_GCM_SHA256  Hit HTTP/1.1    -   -   50108   0.002   Hit text/html;%20charset=iso-8859-1 244 -   -
为什么我不能在HTTP200中使用微调器,为什么url最终会被破坏

出于纯粹的沮丧,我把规则改为

RewriteRule /(.*) https://dl2.hexcode.co.za/$1/ [R,L]
它为我的微调器(和其他资源)提供服务,但导致站点显示为不安全,因为资源是http(而不是https)格式的

我必须补充一点,我正在ApacheWeb服务器前运行一个LB

更新: 使用curl来输入CloudFront,我得到的旋转器没有301

curl https://www.hexcode.co.za/spinner.gif -A "Amazon CloudFront" --output s.gif --verbose
curl https://www.hexcode.co.za/spinner.gif -A "Amazon CloudFront" --output s.gif --verbose