繁体   English   中英

如何在同一服务器上的另一个端口网站的nginx 80中显示数据?

[英]How I can display in nginx 80 data of another port website on the same server?

我有这个:

location /cloud/ {
            proxy_pass http://localhost:8000;
    }

但我在浏览器中看不到URL http:// someipaddress / cloud / http:// someipaddress:8000的内容 ,为什么? someipaddress:8000-效果很好。 我也可以做localhost:8000的wget,它可以工作。 我做错了什么?

你想看到的内容http://123.123.123.123:8000/只要您将浏览器指向http://123.123.123.123/somepath/

一种快速的解决方案是在“ somepath”文件夹中创建一个文件“ index.html”,其中iframe占据整个浏览器视口:

<html>
  <title>Redirecting</title>
  <body>
  <iframe src="http://123.123.123.123:8000/" width="100%" height="100%" style="padding: 0px; margin: 0px; border: 0px;"></iframe>
  </body>
</html>

我了解的是您有两个网址

http:// someipaddress / cloud /http:// someipaddress:8000

按照您的示例。 但是,如果您看到域名是相同的。 我认为这是一个无限循环。

如果您必须使用相同的域名,请尝试重新编写,也许它将对您有用。

暂无
暂无

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

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