簡體   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