Artificial intelligent assistant

Subdomain Creation in Amazon EC2 using Nginx Server I am using amazon ec2.... My app is written in Ruby on Rails. I am using Nginx Server. How can I create sub-domain and automate it when a user registers like <

To do this, you need access to your DNS server - either through your domain hoster or whatever you use to manage your DNS zone. The easiest would be to have a wildcard DNS entry (< This will send all subdomains .yourdomain.tld to your EC2 instance(s). Once you have that, you only need some logic in you application which does whatever you want if a valid subdomain (say: user name) is used or redirect to your landing page or an error page if the subdomain is unknown.

Ah, one little thing i sleft. Your webserver has to accept the subdomains. If you use Apache httpd, the following line in your VirtualHost configuration will do the trick:


ServerAlias *.yourdomain.tld


For nginx the configuration should look like this:


server {
server_name *.yourdomain.tld
...
}

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 63d4ef6ef6fdba61b7ffbeb27aeb2097