node.js - How do I route some URL patterns to a specific port? -
i have node server running on port 3000. i'll using handle apis, don't want urls in format
example.com:3000/api/xyz
i want in format:
example.com/api/..
how route /api/ calls port 3000?
example.com serving html pages, have nothing node. node used apis now. found varnish, looks overkill.
an easy way put nginx in front of node server.
you can setup nginx serve static media based on url patterns. can register non-static requests sent upstream node.js server on port 3000
Comments
Post a Comment