attachment_fu and virtual hosts on S3

Hey,

I've gotten attachment_fu working well with Amazon S3.

The only problem is that I don't know how to generate public URLs that contain my much-cooler virtual S3 host names, e.g. 'images.mydomain.com' with the plugin.

Attachment_fu has a ':server' configuration option, which will change 's3.amazonaws.com' to whatever host name you specify. Unfortunately, setting this to your virtually-hosted bucket name ('images.mydomain.com') results in a URL like this:

http://images.mydomain.com:/images.mydomain.com/path/to/file

which does not work, of course.

Does anyone know how I can configure the plug to use my slick virtual host names and generate this:

http://images.mydomain.com/path/to/file

? Am I missing something obvious (very likely)? Or will I need to roll my own URL-substitution scheme?

Thanks so much for any help you can provide.

Rohit <rohitkg@...> writes:

Hey,

I've gotten attachment_fu working well with Amazon S3.

The only problem is that I don't know how to generate public URLs that contain my much-cooler virtual S3 host names, e.g. 'images.mydomain.com' with the plugin.

The trick is to create an S3 bucket named "images.mydomain.com" on S3, then create a CNAME DNS record for that domain that points to s3.amazonsaws.com

You will not be able to generate secure urls (ssl) for your custom domain since S3 uses its own certificates and there is no way for you to issue one for your domain.

Hope that helps.