Errors page for proxied requests

(Read this, then delete it before you post.) To get the best help possible, please:

  • explain what you are trying to do,
    I’m proxying DigitalOcean Spaces space using Caddy.
    When you request an invalid file, DO returns a 403 error.
    Instead of revealing the bucket name, I want to send 404.html

What I’ve tried:

proxy / https://jac.nyc3.digitaloceanspaces.com {
    header_upstream Host jac.nyc3.digitaloceanspaces.com
}
errors stdout {
    403 404.html
}

Link showing 403 response: https://jac.nyc3.digitaloceanspaces.com
Link to file that has valid access: https://jac.nyc3.digitaloceanspaces.com/keyboard.jpg

Spaces is S3 compatible storage.

I don’t think this is possible at the moment - Caddy won’t write a response if the upstream does.

Could be a good candidate for a feature request over at https://github.com/mholt/caddy/issues.

1 Like

Okay I posted an issue: https://github.com/mholt/caddy/issues/1897

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.