Hi there, I’m newbie in web and DNS things. I have a Ubuntu droplet. I created 2 LXC which they gives me web services. I entered nat-pat configuration for them. If you enter http://ipaddress:2082 goes lxc1 http://ipaddress:2083 goes lxc2
abc.com and def.com are my domains . I want to register these domains to my lxcs. Is it possible ? If yes, how ?
abc.com:2082 and :2083 works well now
Regards
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
In order to access a site via the bare domain without a port number in the URL, the service must be listening on port 80 (for HTTP) or 443 (for HTTPS). Only one service can be listen to a port at a time. So in order to do what you want, you’ll need to use a reverse proxy of some sort. Nginx is a good fit for this. Let it listen on port 80 and then direct the request to the appropriate service based on the domain name. Here’s a really basic example:
Note that setting the
server_name
directive is important here.For more info on Nginx, check out: