I'm trying to build a service in which users can publish sites to a subdomain of mine.
I'm planning to use Amazon S3 as the static site hosting but now I need to get into the dark side of domain routing and I'm a bit lost here.
I would need subdomains to point to subfolders within a single Amazon bucket.
And of course, with SSL.
Any tips?
Any persons with devops experience you can recommend me?
Hey Alvaro, am I getting this right? You would like people to publish websites like this:
yoursubdomain.yourdomain./website-1yoursubdomain.yourdomain./website-2yoursubdomain.yourdomain./website-3...
yoursubdomain.yourdomain./website-nIf yes, what you'd need to do is create a S3 bucket, create a
yoursubdomainfolder there and create an Alias (CNAME) record in your DNS tool.After that, you can use the AWS API to create additional subfolders inside your folder of
yoursubdomainwhich S3 will correctly then map to the URL structure above.If the websites are static, you can even add Cloudflare or Cloudfront on top, to cache them.
Otherwise, if your wanted URL structure is:
website-1.yourdomain.comwebsite-2.yourdomain.comwebsite-3.yourdomain.com...
website-n.yourdomain.comyou'd need take a look at setting up wildcard subdomains and then use the AWS API to create folders within your bucket.
I'm not a devops guy tho. Someone might have a better idea.
It's the 2nd scenario.
I'm using PHP to create the folders in the bucket. My issue was with redirecting the wildcard to the appropriate folder.
I think I need CloudFront for that.