Походит на интересную задачу. Я имею, ничего не видели точно как это, и я не могу вообразить различие между http и https, который вызвал бы это.
Лучший способ диагностировать это состоит в том, чтобы разломать его на самые маленькие возможные части. Некоторые возможно предложения:
I'm gussing that http://example.com/styles/4742a4e8.main.css
is actually a file on your node JS application, so refers to http://localhost:8080/styles/4742a4e8.main.css
, but is being reference in the index.html from your node app as /styles/4742a4e8.main.css
With the proxy mapping what is happening is that when you request
http://example.foo/foo/
it's sending a request which is returning http://localhost:8080/index.html
as is. Any references within index.html aren't modified, so when the browser requests componenets it's requesting http://example.com/styles/4742a4e8.main.css
but the file is only really accessible via http://example.com/foo/styles/4742a4e8.main.css
if /styles/ isn't used within example.com you could add
ProxyPass /styles http://localhost:8080/styles
ProxypassReverse /styles http://localhost:8080/styles
But this may become cumbersome if you have lots of directories.
Another approach would be to use relative paths on your node app. So instead of index.html referencing /styles/4742a4e8.main.css
it referenced styles/4742a4e8.main.css
(no leading slash). This might become cumbersome with nested paths in your node app.
A further solution may be to modify your node.js app to be fully run under localhost:/foo so the directory mapping is the same.
I'm not sure any of these solutions are ideal for your use case, but they will hopefully point you in the right direction.