难以从LightTPD服务器到PM2服务器的HTTP请求
背景:
我的个人网站在Raspberry Pi上的LightTPD服务器上运行。我已经转发该服务器的端口(80),因此可以公开访问。
我正在进行一个项目,并且我希望Node.js服务从LightTPD服务器提出请求。我设置了PM2,因此Node.js服务器始终运行。我也转发了该端口(5000)。我已经验证了该服务器正在通过Postman和浏览器
问题工作:
我在提出请求时会收到以下错误:
已被CORS策略阻止:请求客户端不是安全的上下文,并且资源在更私人的地址空间
。private
。
值得注意;我有access-control-wall-wall-Private-network:true
在响应标头中,访问contect-control-request-request-Provate-network:true
在请求标题中。我发现可能解决此问题的唯一其他解决方案是为LightTPD服务器获得SSL证书,并为其使用HTTPS,但是我正在努力设置它是否有效
问题:
- 获得LightTPD的SSL证书允许我向我的PM2服务器提出请求吗?
- 是否有不同的解决方案?
- 此设置有多安全?我期望不多的流量...
Background:
I have my personal website running on a lighttpd server on my raspberry pi. I have that server’s port (80) forwarded so it can be accessed publicly.
I’m in the process of making a project, and I want a node.js service to make requests to from the lighttpd server. I set up pm2 so the node.js server is always running. I have that port forwarded too (5000). I've verified that this server is working via postman and the browser
Problem:
I'm receiving the following error when making requests:
has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space
private
.
Of note; I have Access-Control-Allow-Private-Network:true
in the response header and Access-Control-Request-Private-Network:true
in the request header. The only other solution I've found that might fix this is getting an SSL cert for the lighttpd server and using https for it, however I'm struggling setting that up to see if it would work
Questions:
- Would getting an SSL cert for lighttpd allow me to make requests to my pm2 server?
- Is there a different solution?
- How secure is this setup? I don't expect a lot of traffic...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论