Hello, how can i point several subdomains to ip:port, for example api.domain.com -> 22.333.33.222:3000 app.domain.com -> 22.333.33.222:3001
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.
You can redirect your domain to a certain port. This depends on the WebService you are using -Nginx/Apache. If you are using Nginx, you’ll need to do add a server block to your Nginx’s website config. This can be achieved by using the bellow
Having said that, you’ll need to add it to your subdomain’s Nginx server block/config. If you are unsure how you can do that, I’ll recommend checking out he following article:
If you are using Apache, you have two options, the first one is to add a redirection rule in your website’s .htaccess and the second one would be to do it directly in the Apache’s Vhost file. I like using the first option. In your .htaccess file, you can add the following rule
If you want to use Apache’s Vhost file, I’ll recommend going through the following tutorial :
Hi there @klapovsciuk,
What you can do is:
Hope that this helps! Regards, Bobby
Want to learn more? Join the DigitalOcean Community!
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.
Sign up now