I have dynamic DNS set up and want to be able to access different computers from outside my home. Currently I have a raspberry pi running nginx on 192.168.1.2, with my router at 192.168.1.1. I also have port 80 forward from the router to the raspberry pi, so simply hitting the dynamic DNS URL shows me the phpinfo() page on my pi landing page.
Next I want to be able to go
mydns.com/device1 and maintain that URL while redirecting under the hood to the other device.
In other words, I will see
http://mydns.com/device1, but I will be access
http://192.168.1.3 internally. Additionally, if I type
mydns.com/device1/login it will redirect internally to
I'trying to use
sub_filter like so:
sub_filter_once off; sub_filter_types text/html; sub_filter ""http://192.168.1.3" "http://192.168.1.2" proxy_pass http://192.168.1.3/; proxy_set_header Host $host;
This is working to some degree but not fully. The paths aren't redirecting, eg files in sub-folders. For example:
I want this:
But get this:
This causes a 404, as can be seen in the Console view in Chrome. I get this error:
Failed to load resource: the server responded with a status of 404 (Not Found)
This is on the path:
http://mydns.com/style/basic.css but I need
I can access the CSS file in the address bar by typing in
http://mydns.com/device1/style/basic.css. so I know its accessible, I just can't get NGINX to forward/rewrite these folders.
Can anyone help? Thanks