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

# Type of request: This is a ...

[x] bug report

# Detailed description

 have aws s3 localstack in docker-compose declared as:

```
version: "3"

services:
...
 localstack:
    image: localstack/localstack
    environment:
      - SERVICES=s3
      - USE_SSL=false
      - DEBUG=1
      - DATA_DIR=/tmp/localstack/data
    ports:
      - "4572:4572"
      - "4566:4566"
      - "8083:8080"
    networks:
      - mynetwork
```

After build everything works fine. I am able to connect to the image:
```
docker exec -ti my-project_localstack_1 /bin/bash
```

And make a new bucket using command line:
```
awslocal s3 mb s3://my-bucket
```

Initially I was able to put new objects into the bucket from my php app.
But was not able to see/view list of them from php/postman/browser.

I've made some research and found [this][1] solution.
```
awslocal s3 mb s3://my-bucket

awslocal s3api put-bucket-acl --bucket my-bucket --acl public-read
```

Now, I am able to get list of objects by prefix in anonymous mode (no credentials or tokens) in my Chrome browser and using Postman.

But I fail to get `$s3Client->listObjects(...)`. It always returns empty result.

Note: I am still able to execute `$s3Client->putObject(...)`.
And I checked another commands `$s3client->getBucketAcl(...)` and `$s3Client->getObjectUrl(...)`. They work fine. 
What I want to say, connection to the localstack host from php is fine and instance is working and responding fine.

Here is the code on php side that I use to instantiate `$s3Client`:
```
class S3
{
	/** @var \Aws\S3\S3Client  */
	private static $client = null;
	private static function init()  // Lazy S3client initiation
	{
		if (is_null (self::$client)) {
            self::$client = new Aws\S3\S3Client ([
                'region'  => 'us-east-1',
                'version' => '2006-03-01',
                'credentials'   => false,
                'endpoint' => "http://localstack:4572",
                'use_path_style_endpoint' => true,
                'debug' => true
            ]);
		}
	}  
    ...
    public static function list_objects($bucket, array $options)
	{
		self::init();

        return self::$client->listObjects([
            'Bucket'    => "my-bucket",
            'Prefix'    => "year/month/folder/",
            'Delimiter' => $options['delimiter'] ? $options['delimiter'] : '/',
        ]);
	}
    ...
}
```

This method returns `@metadata->effectiveUri` :
```
 array (size=2)
    'instance' => string '0000000040d78e4d00000000084dbdb3' (length=32)
    'data' => 
      array (size=1)
        '@metadata' => 
          array (size=4)
            'statusCode' => int 200
            'effectiveUri' => string 'http://localstack:4572/my-bucket?prefix=year%2Fmonth%2Ffolder%2F&delimiter=%2F&encoding-type=url'
```

If I take this url and run it in **browser** or **postman** or php docker terminal **curl** it returns list of my files. It only returns empty array when I call it though s3Client in php.

I have a feeling that something is wrong with permissions. But since I don't have that much knowledge and experience with aws-s3 service I can't figure that out. And it seem confusing that some "default" permissions allows client to put objects but restrict to read index. And I can read index of objects using browser or curl, but not through the app.

I've asked[ this question](https://stackoverflow.com/questions/62244318/cant-get-list-objects-from-localstack-s3-bucket-using-php-aws-s3client) on SO.

And someone recommended me to downgrade docker image to `localstack/localstack:0.11.0` and that fixed the issue. 

## Expected behavior

Php aws s3client `listObjects` should return list of objects stored in bucket same as it is returned for curl or browser.

## Actual behavior

Empty list returned


import traceback
import requests
from ssl import SSLError
from asyncio.selector_events import BaseSelectorEventLoop
from six import iteritems
from flask_cors import CORS
from requests.models import Response, Request
from requests.structures import CaseInsensitiveDict
from six.moves.socketserver import ThreadingMixIn
from six.moves.urllib.parse import urlparse
from six.moves.BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from localstack import config
from localstack.config import USE_SSL, EXTRA_CORS_ALLOWED_HEADERS, EXTRA_CORS_EXPOSE_HEADERS
from localstack.constants import ENV_INTERNAL_TEST_RUN, APPLICATION_JSON
from localstack.utils.server import http2_server
from localstack.utils.common import FuncThread, generate_ssl_cert, to_bytes, json_safe, TMP_THREADS
from localstack.utils.aws.aws_responses import LambdaResponse
LOG = logging.getLogger(__name__)
SERVER_CERT_PEM_FILE = 'server.test.pem'
USE_HTTP2_SERVER = True
CORS_ALLOWED_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']
if EXTRA_CORS_ALLOWED_HEADERS:
    CORS_ALLOWED_HEADERS += EXTRA_CORS_ALLOWED_HEADERS.split(',')
CORS_ALLOWED_METHODS = ('HEAD', 'GET', 'PUT', 'POST', 'DELETE', 'OPTIONS', 'PATCH')
CORS_EXPOSE_HEADERS = ('x-amz-version-id', )
if EXTRA_CORS_EXPOSE_HEADERS:
    CORS_EXPOSE_HEADERS += tuple(EXTRA_CORS_EXPOSE_HEADERS.split(','))
class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):