简体   繁体   English

如何在Nginx代理后面配置weinre?

[英]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.

相关问题 如何配置 --public-host 以在 nginx 反向代理后面运行 angular 通用应用程序? - How to configure the --public-host to run angular universal app behind nginx reverse proxy? 如何配置 NGINX 来代理 API 调用到部署在 Kubernetes 上的后端? - How to configure NGINX to proxy API calls to backend deployed on Kubernetes? 如何将 Nginx 配置为反向代理来执行 this.network 模式? - How to configure Nginx as reverse proxy to do this network schema? 无法将Nginx配置为WebSocket的反向代理 - Can't configure Nginx as Reverse Proxy for WebSocket Docker中Nginx代理后面的node.js代理应用 - node.js proxy app in docker behind nginx proxy 如何将Visual Studio代码调试器附加到在nginx代理后面的docker机器上运行的Node.JS应用程序 - How To Attach Visual Studio Code Debugger to Node.JS Application running on docker machine behind nginx proxy 如何在代理后面配置node.js(express.js)应用程序? - How to configure node.js (express.js) app behind proxy? 如何跟踪 Nginx 反向代理后面的应用程序的上传进度? - How can I track upload progress from app behind Nginx reverse proxy? 环回:如何配置Nginx? - Loopback: how to configure Nginx? 如何在centos 6.4 virtualbox客户端上使用express设置和配置node.js到nginx反向代理? - How to set and configure node.js with express to nginx reverse proxy on centos 6.4 virtualbox client?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM