简体   繁体   中英

cannot serve static files using caddy + django + gunicorn

I'm working on a project that's using caddy as a web server and proxy, django as the backend, and gunicorn as the wsgi. But everything all works well except I can't serve the static files.

This is my Caddyfile.

mydomain.com {
    root * /path/to/staticfile/
    file_server
    encode zstd gzip
    @notstatic {
        not path /path/to/staticfile/*
    }
    reverse_proxy @notstatic app:8000
}

Is there anything wrong that I have used?

How about getting rid of the @notstatic , ie:

mydomain.com {
    root * /path/to/staticfile/
    file_server
    encode zstd gzip
    reverse_proxy app:8000
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM