简体   繁体   中英

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

I have this:

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

but I can't see in browser in url http://someipaddress/cloud/ content of http://someipaddress:8000 , why? someipaddress:8000 - works well. I also can do wget of localhost:8000 and it works. What I am doing wrong?

You want to see the content of http://123.123.123.123:8000/ whenever you point your browser to http://123.123.123.123/somepath/ .

A quick solution would be to create a file "index.html" inside the "somepath" folder with an iframe occupying the whole browser viewport:

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

What I understand is u have two urls

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

As per ur example. However if u see the domain name is the same. This makes it in my opinion a infinte loop.

if u have to use the same domain name then try rewrite maybe it will work for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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