0

Basically when the server gets request from asdf.com it should go to the flask instance running at 5000, when server gets request from fdsa.com it should go to another flask instance (totally different app) running on 5001 and so on.

How can I achieve this, in node.js I was able to use http-proxy and route domains to node.js instances running on different ports.

3
  • Are you using a webserver in front of flask in this case, e.g. nginx or apache? Commented Dec 9, 2013 at 23:47
  • no webserver, the flask server runs on port 80 for a domain Commented Dec 10, 2013 at 0:15
  • I used this before I wonder if I can point it to flask server github.com/nodejitsu/node-http-proxy Commented Dec 10, 2013 at 0:16

1 Answer 1

3

What you want to do is called a reverse proxy.

You need to run the reverse proxy on port 80 and configure it to forward requests to the ports where your apps are listening on based on some criteria, like matching regular expressions on the requested hostname.

A popular reverse proxy is nginx, but if you like node-http-proxy that should work as well, and in fact they show an example of how to setup a proxy table, which is similar to your needs.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.