简体   繁体   English

Angular 6:从 HTTPS 打印到 HTTP 打印机

[英]Angular 6 : Print to HTTP printer from HTTPS

I have an Angular 6 application running behind Nginx with HTTPS.我有一个使用 HTTPS 在 Nginx 后面运行的 Angular 6 应用程序。

I want to send commands to my ZPL printer to print labels but the printer accepts only HTTP protocol.我想向我的 ZPL 打印机发送命令以打印标签,但打印机只接受 HTTP 协议。 Browser won't let me run HTTP stating CORS issues.浏览器不会让我运行 HTTP 说明 CORS 问题。

What could be the possible solution for this?可能的解决方案是什么?

Disabling CORS on browser is not a solution在浏览器上禁用 CORS 不是解决方案

The most straightforward solution would be to configure nginx as a reverse proxy to the zebra printer.最直接的解决方案是将 nginx 配置为 zebra 打印机的反向代理。 That keeps your browser request in the same domain.这使您的浏览器请求保持在同一域中。

https://linuxize.com/post/nginx-reverse-proxy/ https://linuxize.com/post/nginx-reverse-proxy/

如果客户端在同一网络中,您可以在电子角度应用程序中转换您的应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM