Rewrite or redirect?

1. Caddy version (caddy version):

v2.3.0 h1:fnrqJLa3G5vfxcxmOH/+kJOcunPLhSBnjgIvjXV/QTA=

2. How I run Caddy:

Home Assistant add on.

a. System environment:

System: Home Assistant OS 6.0 (amd64 / generic-x86-64)
Home Assistant Core: 2021.6.6
Home Assistant Supervisor: 2021.06.6

b. Command:

Paste command here.

c. Service/unit/compose file:

d. My complete Caddyfile or JSON config: {

3. The problem I’m having:

I’ve setup GitHub - timvisee/send: Simple, private file sharing. Mirror of in Docker, exposing it on port 1443. So when a file is uploaded, the URL to share is It works as expected using local IP addresses. I would like to share these links with family, but I don’t want to give them (and everybody else) the opportunity to upload files themself (no access to, thus I would like to basically share which then translates to

4. Error messages and/or full log output:

Error during parsing: for now, URLs for proxy upstreams only support scheme, host, and port components

5. What I already tried:

So I’ve found out that I should use either rewrite or redirect to accomplish this.

I did have a go with rewrite (from Attempting to reverse proxy to a folder w/ Caddy 2 - #4 by Whitestrake), but now I get error: Error during parsing: Wrong argument count or unexpected line ending after ‘rewrite’. {
    rewrite /download{uri}

So what is the correct way to accomplish this?

6. Links to relevant resources:

You’re close. This

Should be

rewrite * /download{uri}

Thanks a lot. You were right.
Unfortunately, the application does not work as intended, the page is not rendered correct.

Can you clarify what this means?

What does it look like? How is it supposed to look like? And are you seeing any errors?


This topic was automatically closed after 30 days. New replies are no longer allowed.