Welcome! Log In Create A New Profile

Advanced

reverse proxy does not load webpage data

February 01, 2021 03:11AM
Hey,

I am quite new with nginx. And so my problem might be more on a basic level.
I am running a html website. This is not an official hosted one but more an internal service webpage of some device.
It is installed on a PC (PC-device) together with nginx, that supports all the data needed for the webpage.
If I call the webpage from a connected PC (PC-browser) everything is working fine.
But now I’d like to run a reverse-proxy (PC-proxy) in between.
So the PC-browser does not see the PC-device anymore.
PC-device is linked to PC-proxy via 192.168.5.0.
PC-browser is linked to PC-proxy via 192.168.1.0.
When I call the webpage now the index.html will be loaded via the proxy-pass configuration on the PC-proxy (also nginx), but all the next stuff like .js files and image files are not.
I tested a lot but I am stuck.
This structure of a reverse proxy looks very basic for me. But I don’t get it run.

My configuration:

PC-device
/path/index.html
<img src="/images/logo.jpg" …>

nginx.conf
location /images/
absolute_image_path

PC-proxy
nginx.conf
location /device/
proxy_pass 192.168.5.1/path
index.html

PC-browser
url: 192.168.1.1/device/index.html

=> index.html will be loaded correctly from PC-device, because of the proxy-pass configuration
=> but the Logo-image, that will be loaded by the index.html, will not be found.

So, how does a reverse-proxy load data for a webpage ?
How should nginx(PC-proxy) know, where to find the image-file /images/logo.jpg that is asked for by the webpage ?
Or is it necessary that all data of the webpage has to be relative to the starting point “192.168.1.1/device/index.html” ?
I am not sure if my misunderstanding is related to the webpage structure or to the reverse-proxy function.

Thanks for any help.

sorry, I posted this problem already on the german list, but got no answer.
As this english list seems more crowded, I'd like to give it a second try.
Subject Author Posted

reverse proxy does not load webpage data

petrg February 01, 2021 03:11AM

Re: reverse proxy does not load webpage data

Francis Daly February 01, 2021 05:54AM

Re: reverse proxy does not load webpage data

petrg February 02, 2021 02:21AM

Re: reverse proxy does not load webpage data

petrg February 02, 2021 02:24AM

Re: reverse proxy does not load webpage data

Francis Daly February 03, 2021 01:12PM

Re: reverse proxy does not load webpage data

petrg February 08, 2021 02:19AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 224
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready