0

I have a grails app I want to host. The issue is I'm not sure how to map my domain name to my project. On my machine the url is

localhost:8080/myProject/controller/action

it is my understanding that when I purchase a domain, it will replace the "ENDPOINT" in my url, making

www.mydomain.com/myProject/controller/action

What do I need to do when I purchase my domain so that the website is

www.mydomain.com/controller/action

and have the domain name cover

localhost:8080/myProject
chrislovecnm
  • 2,549
  • 3
  • 20
  • 36
Matt Westlake
  • 3,499
  • 7
  • 39
  • 80

2 Answers2

0

You will need to add A-record, that points to your host's IP address, in the NameServer. When you purchase the domain, the registrar will let you configure this on their NameServer.

Manish Maheshwari
  • 4,045
  • 2
  • 15
  • 25
0

You have a couple of options. Use a web server to proxy the app server, and have it replace the project name. The other option if you are using tomcat is to replace the ROOT.war and have tomcat listen to 443 and 80.

In my production environments I use nginx to proxy tomcat, and also have nginx serve the artifacts such as javascript.

Deploying my application at the root in Tomcat talks about ROOT.war

Here is a link to using nginx

http://www.componentix.com/blog/18/hosting-grails-web-applications-using-tomcat-and-nginx-our-configuration

I prefer nginx ... but it adds a layer of complexity.

You will also need to update grails.serverURL in Config.groovy.

Community
  • 1
  • 1
chrislovecnm
  • 2,549
  • 3
  • 20
  • 36