<!-- Love localstack? Please consider supporting our collective:
👉  https://opencollective.com/localstack/donate -->

# Type of request: This is a ...

- [x] bug report
- [ ] feature request

# Detailed description
I get a 404 when I request a file I uploaded via a HEAD request.
This only happens when using the new edge router port.
I think there's faulty logic in the edge router when looking at HEAD requests.

## Expected behavior

I expect the behavior I get from requesting via the dedicated S3 port (HTTP 200 if a file exists)

## Actual behavior

A 404 on HEAD request through the edge router port.

# Steps to reproduce
```
version: '2.2'

services:
  localstack:
    image: localstack/localstack
    ports:
      - '4566:4566'
    environment:
      - SERVICES=s3
      - HOSTNAME_EXTERNAL=s3.test

```
```
docker-compose up -d
```
Making a bucket and uploading a file:
```
AWS_ENDPOINT_URL=http://s3.test:4566
aws --endpoint-url=$AWS_ENDPOINT_URL s3 mb s3://attachments
aws --endpoint-url=$AWS_ENDPOINT_URL s3 cp test s3://attachments
```
Lastly, HEADing the file to see if it exists.
```
$ curl -I $AWS_ENDPOINT_URL/attachments/test -H 'Authorization: aaa'
HTTP/1.1 404 Not Found
Server: BaseHTTP/0.6 Python/3.8.2
Date: Wed, 03 Jun 2020 21:28:46 GMT
Content-Length: 21
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: HEAD,GET,PUT,POST,DELETE,OPTIONS,PATCH
Access-Control-Allow-Headers: authorization,content-type,content-md5,cache-control,x-amz-content-sha256,x-amz-date,x-amz-security-token,x-amz-user-agent,x-amz-target,x-amz-acl,x-amz-version-id,x-localstack-target,x-amz-tagging
Access-Control-Expose-Headers: x-amz-version-id
```
Localstack logs from requesting via *:4566
```
localstack_1  | Starting edge router (https port 4566)...
localstack_1  | Starting mock S3 service in http ports 4566 (recommended) and 4572 (deprecated)...
localstack_1  | 2020-06-03T21:04:36:INFO:localstack.multiserver: Starting multi API server process on port 38679
localstack_1  | Ready.
localstack_1  | 2020-06-03T21:04:41:INFO:localstack.utils.persistence: Restored 10 API calls from persistent file: /tmp/localstack/recorded_api_calls.json
localstack_1  | 2020-06-03T21:05:09:INFO:localstack.services.edge: Unable to find forwarding rule for host "s3.test:4566", path "/attachments/test", target header "", auth header ""
```

Switching the exposed port to 4572 and requesting through there gives me:
```
AWS_ENDPOINT_URL=http://s3.test:4572
```
```
$ curl -I $AWS_ENDPOINT_URL/attachments/test -H 'Authorization: aaa'
HTTP/1.1 200 OK
Server: BaseHTTP/0.6 Python/3.8.2
Date: Wed, 03 Jun 2020 21:39:38 GMT
Content-Type: binary/octet-stream
ETag: "d41d8cd98f00b204e9800998ecf8427e"
last-modified: Wed, 03 Jun 2020 21:31:11 GMT
Content-Length: 0
Access-Control-Allow-Origin: *
x-amz-request-id: 3144F10D603C9424
x-amz-id-2: MzRISOwyjmnup3144F10D603C94247/JypPGXLh0OVFGcJaaO3KW/hRAqKOpIEEp
Access-Control-Allow-Methods: HEAD,GET,PUT,POST,DELETE,OPTIONS,PATCH
Access-Control-Allow-Headers: authorization,content-type,content-md5,cache-control,x-amz-content-sha256,x-amz-date,x-amz-security-token,x-amz-user-agent,x-amz-target,x-amz-acl,x-amz-version-id,x-localstack-target,x-amz-tagging
Access-Control-Expose-Headers: x-amz-version-id
```
parsed_path = urlparse.urlparse(path)
        
        
        if 's3.amazonaws.com' not in headers.get('host', ''):
            headers['host'] = 'localhost'
        
        if 'Content-MD5' in headers and not self.is_s3_copy_request(headers, path):
            response = check_content_md5(data, headers)
            if response is not None:
                return response
        modified_data = None
        
        bucket_name = get_bucket_name(path, headers)
        if method == 'PUT' and not re.match(BUCKET_NAME_REGEX, bucket_name):
            if len(parsed_path.path) <= 1:
                return error_response('Unable to extract valid bucket name. Please ensure that your AWS SDK is ' +
                    'configured to use path style addressing, or send a valid <Bucket>.s3.amazonaws.com "Host" header',
                    'InvalidBucketName', status_code=400)
            return error_response('The specified bucket is not valid.', 'InvalidBucketName', status_code=400)
        
        to_find = to_bytes('<LocationConstraint>us-east-1</LocationConstraint>')
        if data and data.startswith(to_bytes('<')) and to_find in data:
            modified_data = data.replace(to_find, to_bytes(''))
        
        
        
        
        if headers.get(CONTENT_SHA256_HEADER) == STREAMING_HMAC_PAYLOAD:
            modified_data = strip_chunk_signatures(modified_data or data)