-1

I am using NGINX Proxy Manager with a Custom Location "/setup" which redirects to a reolink IP camera on ip address 192.168.1.50.

Custom Location Setup

The problem is when I open a browser and connect to the target hostname i.e.

http://somedomain.com/setup

What happens, is the reolink camera host attempts to serve javascript, css etc files from itself, at the level above /setup, i.e. the root of the host and these files of course don't exist there.

For example (there are lots of files, this is just one) the host is trying to get it's css files from here: https://somedomain.com/css/glDatePicker.default.css?timeVersion=1603795049091

When in fact it should be getting them from here: https://somedomain.com/setup/css/glDatePicker.default.css?timeVersion=1603795049091

Any suggestion on how this can be resolved ?

crankshaft
  • 2,607
  • 4
  • 45
  • 77
  • Are you able to show any of the nginx config? That graphic doesn't show how it's configured, only the target and proxy destination. – Bman70 Sep 02 '22 at 03:25
  • Have you tried `sub_filter "http://your_server/" "http://your_server/setup/"; sub_filter_once off;` as custom nginx config – Deckerz Sep 13 '22 at 15:19

1 Answers1

0

One way you could resolve this is by bundling everything into one HTML file. You can use a tool like webpack to do this, but webpack certainly isn't the only one. Here is another SO question about how to do this with webpack. Honestly just googling "bundle html, css, and js into one file" will bring up some good results too.

Michael M.
  • 10,486
  • 9
  • 18
  • 34
  • Thanks, but the host is a REOLINK IP camera, not a static website that was written by me, so this is not a viable option in this case. – crankshaft Sep 02 '22 at 09:09