【发布时间】:2018-07-10 15:56:31
【问题描述】:
我们正在尝试更新我们的内部服务器基础架构,并通过 Nginx 服务器代理对我们 R 闪亮网络服务器的所有访问。我能够从闪亮的服务器获得响应,但我无法通过 Nginx 服务器获取 css/js 等相关文件。
设置:
2 个 docker 容器(1 个用于托管 nginx,1 个运行 R 用于闪亮的应用程序)
两个 docker 容器都是 docker 网络的成员
闪亮的服务器监听端口 7676(内部 IP 地址 172.18.0.3)
nginx 服务器正在托管几个带有 iFrame 的静态 html 文件(旧版,无法摆脱),它应该显示闪亮服务器的内容
访问 nginx-server/QueryLandscape.html 会加载带有 iFrame
<iframe src="ilandscape"></iframe> 的页面
iFrame 工作:它加载 R-shiny 应用程序的静态部分,但它不加载相关的 JS/CSS/....(例如
http://nginx-server:8001/ilandscape/shared/shiny.css)在 nginx-docker 容器中,我可以访问这个 css 文件
wget 172.18.0.3:7676/shared/shiny.css
Nginx.conf
location /ilandscape/ {
proxy_pass http://172.18.0.3:7676/;
#proxy_redirect http://172.18.0.3:7676/ $scheme://$host/;
# websocket headers
proxy_set_header Upgrade $http_upgrade;
proxy_http_version 1.1;
proxy_read_timeout 20d;
proxy_set_header Host $host;
}
我的 nginx conf 中缺少什么来代理/重定向 http://nginx-server:8001/ilandscape/shared/shiny.css --> 172.18.0.3:7676/shared/shiny.css ?
感谢您的帮助, 托比
【问题讨论】: