Aleks
Aleks

Reputation: 5854

Serve static files by separate server

I have a simple web server in Node.JS/Express.

I would like to somehow dispach all requests for a statis HTML content to another instance of Express web server (running on the same machine). The idea is to release the main server ASAP for new requests and leave the handling of all static content to this second instance.

Is it posible that the second instance return the static content to the directly to the caller? I mean withount passing it back to the main server?

Upvotes: 1

Views: 145

Answers (1)

Some programmer dude
Some programmer dude

Reputation: 409166

This could easily be handled by having a reverse proxy which redirects all requests for URL's with a /static (for example) prefix to one server, and all other URL's to your node.js server.

Upvotes: 2

Related Questions