我在该服务器中有一个专用服务器,我部署了5个nodejs应用程序.
domain name: www.nnd.com
dedicated server ip: xxx.xx.x.60
Run Code Online (Sandbox Code Playgroud)
我有域指向我的专用服务器IP.
子域名是:
app1.nnd.com pointed to xxx.xx.x.60
app2.nnd.com pointed to xxx.xx.x.60
app3.nnd.com pointed to xxx.xx.x.60
app4.nnd.com pointed to xxx.xx.x.60
app5.nnd.com pointed to xxx.xx.x.60
Run Code Online (Sandbox Code Playgroud)
现在在基于我需要路由代理的子域的nginx配置文件中.例:
{
listen:80;
server_name:xxx.xx.x.60
location / {
#here based on subdomain of the request I need to create proxy_pass for my node application
}
}
Run Code Online (Sandbox Code Playgroud)
是否有任何条件,如何从代理标头获取原始域名?
如何允许客户端使用node.js下载存储在服务器中的pdf文件
请有人帮我解决这个问题.
fs.readFile('temp/xml/user/username.pdf',function(error,data){
if(error){
res.json({'status':'error',msg:err});
}else{
res.json({'status':'ok',msg:err,data:data});
}
});
Run Code Online (Sandbox Code Playgroud) 我正在使用pdfkit(nodejs模块)生成pdf文档.我需要将pdfkit对象转换为缓冲区并将响应作为附件文件发送而不在服务器中保存文件.
我正在使用输出功能来实现这一目标:
pdfdocument.output(function(buffer){
return buffer;
});
Run Code Online (Sandbox Code Playgroud)
pdfkit弃用了输出函数.
所以现在我不知道怎么做任何想法......