[英]How to configure weinre behind Nginx proxy?
I have the latest weinre installed (2.0.0-pre-I0Z7U9OV). 我安装了最新的weinre (2.0.0-pre-I0Z7U9OV)。 I can start it, all is working fine, but I need to run it behind a Nginx Proxy to be able to use a trusted SSL Certificate.
我可以启动它,一切都很好,但是我需要在Nginx代理后面运行它,才能使用受信任的SSL证书。 So what I tried is the following:
所以我尝试了以下内容:
upstream weinre {
server 127.0.0.1:8080;
}
server {
...
location /weinre/ {
proxy_pass http://weinre/;
proxy_set_header Host $host;
}
}
The site is opening, all fine, but when adding the target script to my mobile page, I can't see it appear in the targets list. 该网站正在打开,一切正常,但是将目标脚本添加到我的移动页面时,我看不到它出现在目标列表中。 So I started to dig into it and found the follwing in the Chrome console:
因此,我开始深入研究它,并在Chrome控制台中找到了以下问题:
POST https://domain.net/ws/target 404 (Not Found)
Why is it POSTing to ws/target
and not weinre/ws/target
? 为什么要发布到
ws/target
而不是weinre/ws/target
? Since everything else is working under the weinre sublocation. 由于其他所有内容都在weinre子位置下工作。
Is it even possible to run weinre under such setup? 在这种设置下甚至可以运行weinre吗?
Not quite sure what's going on there; 不太确定那里发生了什么; what is the URL of the of the target script you are embedding in your page?
您要嵌入到页面中的目标脚本的URL是什么? It's possible to override the URL of the weinre server, instead of having it calculated from the target script, by setting the global
window.WeinreServerURL
, as you can see in the Target.coffee file. 可以通过设置全局
window.WeinreServerURL
来覆盖weinre服务器的URL,而不是通过目标脚本来计算它,如在Target.coffee文件中看到的那样。 You can see how the server URL is used to get the URL to the "socket" URL here . 您可以在此处查看如何使用服务器URL将URL获取到“套接字” URL。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.