By Ram
Hi, I am using Spring Boot to make a java web application which uses an embedded tomcat server. I am able to deploy and run successfully on my droplet but how do I configure a subdomain for it? I couldn’t find any docs/tutorial regarding this online.
For ex., let’s say my app is running in directory /var/www/my_web_app. I want to configure a subdomain which would map to this directory.
Note: I have other applications running on the same server as well which uses a normal apache server and running on port 80. I have defined various VirtualHosts for it. I wanted something similar for embedded tomcat as well.
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!
You need to do the same thing as you have done with virtualhost, except instead of serving a directory you forward the requests to tomcat.
I don’t have a tomcat example, but this approach should work for you: https://levlaz.org/proxy-everything-into-a-linux-container-with-nginx/
Ignore the LXC part, just focus on the fact that you are serving from an application running on a different port rather than just a web directory.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.