diff --git a/_compose/caddy/conf/Caddyfile b/_compose/caddy/conf/Caddyfile index 2df4ee6..d59003d 100644 --- a/_compose/caddy/conf/Caddyfile +++ b/_compose/caddy/conf/Caddyfile @@ -1,4 +1,5 @@ :8300, localhost { + root * /data/dist # Vue Router history模式,避免刷新后404页面;字符中间不可有空格 try_files {path} /index.html @@ -9,4 +10,14 @@ reverse_proxy ruoyi-admin:8080 } file_server + encode zstd gzip + # CORS + import CORS +} + +(CORS) { + header replace Access-Control-Allow-Origin "*" + header replace Access-Control-Allow-Headers "*" + header replace Access-Control-Allow-Methods "*" + header replace Access-Control-Request-Method "POST, GET, OPTIONS" } \ No newline at end of file