1

I just set up an Python app on an EC2 Ubuntu server. I can go to www.mydomain.com:6332 to view the app but I'd like it to be at www.mydomain.com (without port 6332).

How could I achieve this?

Max Min
  • 113
  • 2

1 Answers1

0

This can be done in various ways:

  • Easiest is to simply let your python app listen on port 80
  • Second-best would be an iptables rule that redirects the traffic (iptables -t nat -A PREROUTING -p tcp --dport 80 --redirect --to-ports 6332)
  • And finally, you can set up a reverse proxy, such as nginx or apache, to forward the traffic to your app. If it's a python app that can be run in a wsgi container (such as ones using flask or django), this would actually be the best option.
Dennis Kaarsemaker
  • 19,277
  • 2
  • 44
  • 70
  • Thanks, I went with the iptable solution, here's my exact syntax: sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 6332 – Max Min Apr 06 '13 at 19:27