J
J
jFox2014-10-04 18:20:41
linux
jFox, 2014-10-04 18:20:41

How to work with dynamic virtual subdomains in Linux?

We have Elementary OS based on Ubuntu 12.
The Rails application needs to dynamically create subdomains locally.
I could not find an analogue of pow.cx for my system (there is no installation documentation for xip.io on the network).
Help out.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vsuhachev, 2014-10-05
@vsuhachev

/etc/hosts

3
3vi1_0n3, 2014-10-05
@3vi1_0n3

1) Create a "*" (asterisk) entry in bind, it must come after all entries for the domain. This will need to be done once.
2) Parse the HTTP request header "Host: ..." in the application. You can put, for example, nginx as a frontend and do hostname mapping at its level.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question