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

node.js + nginx - now?


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -