node.js - nodeJs builds an independent domain name static server
我想大声告诉你
我想大声告诉你 2017-05-16 13:45:01
0
1
598

When using nodejs instead of Nginx to build a local web development environment, if you want to build a static resource server with an independent domain name and separate domain names for page file resources and static resources, how can you achieve an independent domain name for static resources? Please give me some ideas, thank you!

我想大声告诉你
我想大声告诉你

reply all(1)
世界只因有你

It is recommended to use nginx, after all, nginx is good at doing this.

If you have to use node, I think you should build two node services to separate dynamic and static resources; one handles page resources; the other only puts static resources; listen to different ports respectively; realize the separation of file resources and static resources;

As for what you said about implementing independent domain names for static resources; in fact, dynamic resources cannot have their own independent domain names, if there are multiple dynamic resources; this requires nginx as a reverse proxy; node web pages recommend using http-proxy, but I don’t have it. Tried it; I used nginx as a reverse proxy.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!