我有以下设置:
server-external-ip,我想将其用作两台打印机的 IPP 网关可以通过以下 IPP URL 访问这两个打印机(从 LAN 和从 Apache 服务器):
http://printer-1-local-ip/printerhttp://printer-2-local-ip/printer(打印机并未物理连接到 Web 服务器。)
我希望可以通过以下 URL 从 Internet 访问它们:
http://server-external-ip/prn1http://server-external-ip/prn2IPP 专门通过 HTTP 请求到打印机地址工作(即整个打印过程通过http://printer-X-local-ip/printer URL 上的POST 请求发生),所以我只需要重定向(即反向代理与 Apache) URL 1 和 2 以上。
Apache 正在提供其他内容,因此我无法用自定义程序(例如,netcat 或 netsed)替换它。此外,我无法在不同的端口上运行自定义程序,因为打印机客户端只能在端口 80 上访问服务器。
然后我尝试了以下 Apache 配置:
RewriteRule ^/prn1$ http://printer-1-local-ip:80/printer [P]
ProxyPassReverse /prn1 http://printer-1-local-ip
Run Code Online (Sandbox Code Playgroud)
将 Windows 客户端连接到http://server-external-ip/prn1 URL,反向代理工作。但是 IPP 协议也将完整的设备 URL …