vijay
vijay

Reputation: 107

Adding port number to Elastic IP in domain name integration using Route 53

I want to add my port number to my Elastic IP to integrating into my domain.But it won't allow adding a port. It only allows me to add my Elastic IP.How can I add my port to my elastic IP? Like, my domain is www.xxyyzz.com and I want to add my Elastic IP xx.xx.xx.xx and my port:8888 to that domain name. If i run www.xxyyzz.com it will point xx.xx.xx.xx:8888. How can I achieve this? Or is there any other way to achieve it?

Upvotes: 1

Views: 836

Answers (2)

vijay
vijay

Reputation: 107

Finally ,I solved the problem using iptables to redirect any request to my own port 8888. I used below command to redirect all the request fro 80 to 8888. Now it works fine.

sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8888

Upvotes: 1

drsromero
drsromero

Reputation: 311

You should use a reverse proxy as nginx to do it. It's no a DNS rule.

server {
    listen 80;
    server_name your-domain-name.com;
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://X.X.X.X:8888;
    }
}

Upvotes: 2

Related Questions