Hello,
I'm not sure if this is something you can help with as I don't know if this is a webconfig issue or more nginx orientated - but I am trying to dockerise this application and reverse proxy it using nginx.
Do you know if this application can be reversed proxied?
When I try to set a location in my nginx config as an entry point for the applciation, none of the assets are loaded on the relative path I set and the links on the page all point to the root of my nginx server and not the location I set in my nginx.conf file...
I have reversed proxied another node application (express based) and this seems to work without issue so I am not sure if there is something in the architecture of this app that will prevent me from reverse proxying it...
I am trying to make this app available on the following url
http://domain-name/memberdemo
I am reverse proxying an express base site to http://domain-name and that works fine...
The entries in my nginx.conf file are as follows:
location / {
proxy_pass http://192.168.1.104:3000/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
below is the location block I am trying to host your app on
location /memberdemo/ {
proxy_pass http://192.168.1.66:3000/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
The first location block reverse proxies to a host on my lan running an express based application and works fine as all assets are loaded and the links work as needed...
The second location block reverse proxies to the universal react app running on another machine on my lan - if I enter http://192.168.1.66:3000 in my browser the app loads as expected with all assets loaded and the links work as needed from my client machine...
If I try to access it through the reverse proxy no assets are loaded and all the links point to the location of the first 'location' block as shown above so I get page not found when I click on them...
e.g.
When I go to http://domain-name/memberdemo
I see the universal app load its default page but no assets are loaded and I see 'not found' errors in the browser console - if I hover or click on a link on the un-styled page the links point to the root of my nginx server so I get a not found error if clicked...
I know this may not be an issues with your application but I have been trying for days to find a way to make this work so I thought I might ask you if you know of any issues that may be effecting this... or reasons why this application can not be reverse proxyed...
My webconfig looks like this:
{
"siteURL": "http://192.168.1.66:3000",
"environment": "production"
}
Thanks for any help or pointers you can give...