帖文详情
avatar
@maisui@el5.net

想问一下各位站长有没有遇到过mastodon这个只显示这样logo的情况,web服务器是caddy2,mastodon、caddy2整个都是docker中配置的 @board

查看详情
0
0
0
avatar
@XYenon@pleroma.xyenon.bid
@maisui @board 有没有用 cf 的 auto minify 或者类似的功能
查看详情
0
0
0
avatar
@maisui@el5.net

@XYenon @board 换了一个新的caddy配置,大概解决了,是caddy的问题

查看详情
0
0
0
avatar
@XYenon@pleroma.xyenon.bid
@maisui @board 是哪项配置的问题的,看这个现象很像是之前见过的 SRI 校验不过的情况
查看详情
0
0
0
avatar
@maisui@el5.net

@XYenon

旧配置:
```Caddyfile
{
email example@example.com
}

example.com {
@local {
file
not path /
}
@local_media {
path_regexp /system/(.*)
}
@streaming {
path /api/v1/streaming/*
}
@cache_control {
path_regexp ^/(emoji|packs|/system/accounts/avatars|/system/media_attachments/files)
}

root * /home/mastodon/live/public
log {
output file /var/log/caddy/mastodon.log
}

encode zstd gzip

handle_errors {
rewrite 500.html
file_server
}

header {
Strict-Transport-Security "max-age=31536000"
}
header /sw.js Cache-Control "public, max-age=0"
header @cache_control Cache-Control "public, max-age=31536000, immutable"

handle @local {
file_server
}

## If you've been migrated media from local to object storage, this navigate old URL to new one.
# redir @local_media yourobjectstorage.e...{http.regexp.1} permanent

reverse_proxy @streaming {
to http://mastodon-streaming:4000

transport http {
keepalive 5s
keepalive_idle_conns 10
}
}

reverse_proxy {
to http://mastodon-web:3000

header_up X-Forwarded-Port 443
header_up X-Forwarded-Proto https

transport http {
keepalive 5s
keepalive_idle_conns 10
}
}
}
```

新配置:
```Caddyfile

{
email example@example.com
}

example.com {
root * /home/mastodon/live/public

@staticfiles file
handle @staticfiles {
file_server
}

handle /api/v1/streaming* {
reverse_proxy mastodon-streaming:4000
}

handle * {
reverse_proxy mastodon-web:3000
}

encode gzip

@mastodonfiles {
path /sw.js */assets/* */avatars/* */emoji/* */headers/* */packs/* */shortcuts/* */sounds/* */system/*
}

header @mastodonfiles {
Cache-Control "public, max-age=2419200, must-revalidate"
Strict-Transport-Security "max-age=63072000; includeSubDomains"
}

header /api/v1/streaming* {
Strict-Transport-Security "max-age=63072000; includeSubDomains"
}

handle_errors {
rewrite 500.html
file_server
}
}
```

查看详情
0
0
0
@maisui@el5.net
0/484
加载中