title: Spring Boot configure a Domain/Host to access in a www.website.com fashion
body: <p>I have a spring boot application. Usually I run my Spring applications on PaaS instances, and configuring a domain name from there is easy enough, however I am running this on a Virtual Private Server, and I cannot, for the life of me, figure out how to run my spring boot so it's accessible with a domain name.</p>
  
  <p>I have already changed my DNS settings so it's pointing to my Virtual Private Server, this VPS also runs some other apache based static websites, I'm pretty confident my DNS settings are correct.</p>
  
  <p>My spring boot application is running using <a href="http://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat" rel="noreferrer">spring-boot-starter-tomcat</a>, the application deploys fine, I can grab my .war file and deploy it using <code>java -jar myApplication.jar</code> on the server.</p>
  
  <p>The application is also accessible remotely by writing <code>my.server.ip:8080</code> on a browser.</p>
  
  <p>However, I've been googling a lot and cannot figure out how to configure Spring Boot so that it'll use my Domain name, so that I can access the website in a standard way: <code>www.mywebsite.com</code>, or even better yet also add an Alias so both <code>mywebsite.com</code> and <code>www.mywebsite.com</code> are valid.</p>
  
  <p>Can anyone point me in the right direction? I know this <a href="https://tomcat.apache.org/tomcat-5.5-doc/config/host.html" rel="noreferrer">can be done in Tomcat</a> but I have no idea of how to configure it.</p>
  
  <p>Since this is a Spring Boot application I do not have <code>.xml</code> files, my Spring Boot configuration is in a <code>application-prod.yml</code> file, and the only <code>.xml</code> file I use is the <code>pom.xml</code> itself.</p>
  
  <p>Any help would be greatly appreciated. </p>