I’m having trouble connecting Route 53 to an EC2 with an app running on the 8080 port. Currently, I can hit and use the app using http://<EC2 name>:8080/<endpoint path>
, but I obviously want to hit it with a domain name instead.
I created a host zone .com, created a record, used record type A and set the ip as the ipv 4 provided by the EC2. I then copied the four ns- route traffic names across to the nameservers in registered domain. Unfortunately, when I hit www.<domain name>/<endpoint path>
I get ‘did not match any documents’.
Is this something I’m missing when setting up the route 53 or is it an issue to do with the port?
Any help would be gratefully received.
2
Answers
Simple enough in the end, I just used sudo java -Dserver.port=80 -jar .jar & No setting up the code differently, just setting it to use port 80. Also found out I had to use sudo, otherwise you get a permission denied when allocating to the root.
You can’t do that with Route53, as R53 is just a DNS resolver: domain name -> IP address (not port).
You have to do redirection of port 80 to 8080 on your instance, not on Route53. A common way is through Nginx that you have to setup and configure on the instance as a reverse proxy.