tes286

一个奇怪的 cloudfront 问题

  •  
  •   tes286 ·
    TES286 · Sep 17, 2024 · 3289 views
    This topic created in 630 days ago, the information mentioned may be changed or developed.

    在 cloudflare R2 存了一些文件,但是用天朝网络 cloudflare 有时不甚稳定,忽慢忽快,于是套了一层 cloudfront ,这个貌似略好一点?

    但是 cloudfront 上一个域名出现了很奇怪的问题,在访问一些特定路径时报 502 ,但是同一站点下的其他路径正常

    其中为了支持 cloudflare ,用 lambda@edge 重写了 Host 头,不过我不觉得问题在这

    有谁知道问题吗?谢谢

    正常路径: https://assets.cdn.tes286.site/.eslintrc.cjs

    异常路径: https://assets.cdn.tes286.site/logo.png

    源站: https://assets.tes286.site

    相关截图:

    https://storage.tes286.site/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202024-09-17%20215904.png

    https://storage.tes286.site/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202024-09-17%20220301.png

    5 replies    2024-09-20 23:26:48 +08:00
    xenme
        1
    xenme  
       Sep 18, 2024 via iPhone
    没记错 edge 无法修改 host header
    allenforrest
        2
    allenforrest  
       Sep 18, 2024
    问个题外话,CF R2 本身有 CF CDN ,这个在国内访问的效果如何?套了 AWS Cloudfront 后体验差异如何?
    tes286
        3
    tes286  
    OP
       Sep 18, 2024   ❤️ 1
    @xenme 能改的,用 lambda@edge 改,具体可以看 https://assets.cdn.tes286.site/cdn-cgi/trace (这个是 cloudflare 提供的)

    @allenforrest 都不太行。 我这(移动)晚上 10 点左右其实都不咋样,不仅是 cdn ,所有出国流量都极慢,包括我的梯子。不过对比起来,cloudfront 略好一点,虽然都不够 1 MBytes/s
    参考: https://storage.tes286.site/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202024-09-18%20224800.png

    不过白天 cloudfront 上限高一些,多线程甚至能满宽带
    allenforrest
        4
    allenforrest  
       Sep 19, 2024
    @tes286 我访问你贴的正常和异常路径都正常
    tes286
        5
    tes286  
    OP
       Sep 20, 2024
    @allenforrest 现在好了,确实已经解决了。aws 控制台还真有点坑

    原本在 lambda 哪里部署到 cloudfront ,我以为全部都配置上了,哪知道只配置了默认路径,像 *.png *.js 之类默认添加的规则还没加上。。。页面上也不说明一下(流汗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4189 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 00:17 · PVG 08:17 · LAX 17:17 · JFK 20:17
    ♥ Do have faith in what you're doing.