When executing:

```
s3AsyncClient.headBucket(HeadBucketRequest.builder()
                    .bucket("local-stack-test-bucket")
                    .build()).join();
```

We get this exception thrown (Java): java.util.concurrent.CompletionException: software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 502, Request ID: null)

I narrowed this down to db4cddea4e4844c1241cca5ac22ecbde08e52064 and found the problem. PR incoming shortly.
x_forwarded_for = headers.get('X-Forwarded-For')
        client_address = self.client_address[0]
        server_address = ':'.join(map(str, self.server.server_address))
        if x_forwarded_for:
            x_forwarded_for_list = (x_forwarded_for, client_address, server_address)
        else:
            x_forwarded_for_list = (client_address, server_address)
        return ', '.join(x_forwarded_for_list)
    def forward(self, method):
        data = self.data_bytes
        forward_headers = CaseInsensitiveDict(self.headers)
        
        if forward_headers.get('Connection', '').lower() != 'keep-alive':
            self.close_connection = 1
        def is_full_url(url):
            return re.match(r'[a-zA-Z+]://.+', url)
        path = self.path
        if is_full_url(path):
            path = path.split('://', 1)[1]
            path = '/%s' % (path.split('/', 1)[1] if '/' in path else '')
        forward_base_url = self.proxy.forward_base_url
        proxy_url = '%s%s' % (forward_base_url, path)
        for listener in self._listeners():
            if listener:
                proxy_url = listener.get_forward_url(method, path, data, forward_headers) or proxy_url
        target_url = self.path
        if not is_full_url(target_url):
            target_url = '%s%s' % (forward_base_url, target_url)