Hi, how to prevent Caddy convert HEAD to GET requests

1. Caddy version (caddy version):

Caddy v2.4.5

2. How I run Caddy:

Download binary file.

a. System environment:

Ubuntu

3. The problem I’m having:

Hi, what is Nginx proxy_cache_convert_head in Caddy?
Caddy is converting HEAD requests to GET requests.

Please properly fill out the help topic template. Do not delete any sections.

I don’t understand your question. Please elaborate. What behaviour are you seeing exactly, and what did you expect? Use curl -v to show what you mean.

@francislavoie Sorry, I don’t receive the email about your reply.

For example, I use HEAD request to check the file is exist:

curl --head https://caddy-forum-uploads.s3.amazonaws.com/original/2X/3/3859a874d26640df74a3b951d8052a3c3e749eed.png

OR

check file has existed in Minio server with the S3 client

    const res = await s3.send(
      new HeadObjectCommand({
        Key: key,
        Bucket: bucket
      })
    )

The request is failed with Caddy as a reverse proxy. And when I saw Caddy logs, the request method was shown as GET.
This bug is same as statObject always returns “'AccessDenied” · Issue #842 · minio/minio-js (github.com)

I want to ask what I need to config in Caddy to prevent Caddy convert the request from HEAD => GET

Again, please completely fill out the help topic template. I need to see what your Caddyfile looks like, and what’s in your logs.

Sorry for wasting your time. I have found out Cloudflare modify the HEAD request to GET request.
Please close this issue.

2 Likes