# Bug Report

# Detailed description
This is a similar issue to #2329, specific to [S3 Presigned URLs](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-presigned-urls.html). Using the edge router port (`:4566`), it is possible to use `generate_presigned_post`, but attempting to use the resultant URL to upload a file to localstack's S3 fails with a 404.

## Expected behavior
Localstack's edge router port should accept POST requests with an S3 Presigned URL (generated from that same Localstack instance) in the same way that the old S3 port (`:4572`) does.

## Actual behavior
While the old S3 port (`:4572`) handles this fine, the edge router responds with a 404 and a message similar to the following:

```
2020-05-24T15:36:54:INFO:localstack.services.edge: Unable to find forwarding rule for host "localhost:4566", path "/local-job-documents", target header "", auth header ""
```

(borrowed from @philippmalkov's comment on #2329 )

```
aws_1  | 2020-05-27T16:24:38:INFO:localstack.services.edge: Unable to find forwarding rule for host "aws:4566", path "/test-bucket", target header "", auth header ""
```

(our observed case with the below setup)

# Steps to reproduce

## Command used to start LocalStack
```
# Used in docker-compose.yml as:
  aws:
    image: localstack/localstack-light
    environment:
      - SERVICES=dynamodb,s3
      - HOSTNAME_EXTERNAL=aws
      - DEBUG=1
      - DATA_DIR=/tmp/localstack/data
    expose:
      - 4566
      - 4572
    volumes:
      - ./.localstack:/tmp/localstack
```

## Client code (AWS SDK code snippet, or sequence of "awslocal" commands)
Client code is a Django app using `boto3` to generate a Presigned URL and then upload a file to it using `requests`, effectively identical to the examples in [the boto3 docs](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-presigned-urls.html)
elif result[0] == 'states' in auth_header or host.startswith('states.'):
        result = 'stepfunctions', config.PORT_STEPFUNCTIONS
    elif '.execute-api.' in host:
        result = 'apigateway', config.PORT_APIGATEWAY
    elif target.startswith('DynamoDBStreams') or host.startswith('streams.dynamodb.'):
        result = 'dynamodbstreams', config.PORT_DYNAMODBSTREAMS
    elif ls_target == 'web' or path == '/graph':
        result = 'web', config.PORT_WEB_UI
    return result[0], result_before[1] or result[1], path, host
def get_port_from_custom_rules(method, path, data, headers):
    """ Determine backend port based on custom rules. """
    
    if 'AWSAccessKeyId=' in path or 'Signature=' in path:
        return config.PORT_S3
    
    stripped = path.strip('/')
    data_bytes = to_bytes(data or '')
    if method == 'GET' and '/' in stripped:
        
        return config.PORT_S3
    if stripped and '/' not in stripped:
        if method == 'PUT':
            
            return config.PORT_S3
        if method == 'POST' and to_bytes('key=') in data_bytes:
            
            return config.PORT_S3
    if path == '/' and to_bytes('QueueName=') in data_bytes:
        return config.PORT_SQS
def get_service_port_for_account(service, headers):