简体   繁体   English

远程服务器上的 HTML 页面未加载

[英]HTML page on remote server does not load

I am doing a local HTML page that will run inside a kind of kiosk.我正在做一个本地 HTML 页面,它将在一种信息亭内运行。 This page is the first page to load, index.html .此页面是要加载的第一页, index.html

This page shows a menu where the user has to choose a language.此页面显示了一个菜单,用户必须在其中选择一种语言。

When the user clicks on an icon and chooses a language, a page opens in the remote server, over https.当用户点击一个图标并选择一种语言时,一个页面在远程服务器中打开,超过 https。

This second page, let's call it second.html , shows the videos in the language chosen.第二页,我们称之为second.html ,以所选语言显示视频。

The problem is that the kiosk refuses to show second.html .问题是信息亭拒绝显示second.html It gives me an error "page cannot be loaded error -6".它给了我一个错误“页面无法加载错误-6”。

When I test it on a browser running on my computer, everything works perfectly.当我在计算机上运行的浏览器上对其进行测试时,一切正常。

The kiosk runs chromium web engine.售货亭运行铬 web 引擎。

I have no means to debug that on the kiosk.我没有办法在信息亭上调试它。 The tool they have provided for debugging is not working properly.他们为调试提供的工具无法正常工作。

Both pages, index.html and second.html load javascripts and css.两个页面, index.htmlsecond.html加载 javascripts 和 css。 For the first one the files are stored locally.对于第一个,文件存储在本地。 For the other one, the files are located in the server.对于另一个,文件位于服务器中。

second.html is being loaded by a link on index.html . second.html正在通过index.html上的链接加载。 No AJAX.没有 AJAX。

Is there any security thing that could prevent second.html from loading when clicked locally?在本地单击时,是否有任何安全问题可以阻止 second.html 加载?

Two possible causes I ran into:我遇到了两个可能的原因:
If index.html is loaded on the kiosk from a locally running webserver the policy of that local server forbids loading content from other servers.如果 index.html 从本地运行的网络服务器加载到信息亭,则该本地服务器的策略禁止从其他服务器加载内容。 Error 6 in android-based kiosk software is "error message of policy".基于 android 的信息亭软件中的错误 6 是“策略错误消息”。 The easiest way is to reconfigure the kiosk-software and/or the server it talks to - nothing you could solve if you have not access to both servers.最简单的方法是重新配置信息亭软件和/或与之通信的服务器 - 如果您无法访问这两个服务器,您将无法解决任何问题。
The second if the file is loaded from local file system can be missing/malformed CORS messages, or if served via localServer is serving http and the remote server uses https missing Cors allowancies. The second if the file is loaded from local file system can be missing/malformed CORS messages, or if served via localServer is serving http and the remote server uses https missing Cors allowancies. A quick and dirty solution would be: Set the header in the page directly using a templating language like PHP.一个快速而肮脏的解决方案是:使用 PHP 之类的模板语言直接在页面中设置 header。 Keep in mind there can be no HTML before your header or it will fail.请记住,在您的 header 之前不能有 HTML ,否则它将失败。

<?php header("Access-Control-Allow-Origin: http://example.com"); ?>

You should check wether your dev-browser uses any "anti local cors" extension or the browser is started with no cors security enabled.您应该检查您的开发浏览器是否使用任何“anti local cors”扩展或浏览器在没有启用 cors 安全性的情况下启动。 That might explain why local works /kiosk not.这可能解释了为什么本地工作 /kiosk 不工作。
If you rule out option 2 more info on the server to server policy scenario is needed to help any further.如果您排除选项 2,则需要有关服务器到服务器策略方案的更多信息以提供进一步帮助。

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

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