I am attempting to run docker-netbootxyz behind a reverse proxy so that I can have the administrative interface located at http://example.com/netbootxyz and the assets at http://example.com/assetsxyz. I am running netbootxyz as a Docker Stack (not just a service), with host-based rather than overlay networking which is better for maintaining stateful connections, and I use HAProxy and Apache to accomplish the reverse proxying.
Setting it up this way mostly seems to work just fine except that the webpage never progresses past saying "Getting Dashboard" with a pulsating disc, at which time I see this in Chrome's debugging console:
If I then examine netbootxyz-web.js, the issue is plainly obvious at line 9. As you will notice in my Apache configuration, I have attempted to remedy the situation by adding the line ProxyHTMLURLMap /socket.io /netbootxyz/socket.io, which has no effect because ProxyHTMLURLMap evidently does not have the proper context to match that line, so "/socket.io" never gets modified, and it looks like it's the wrong thing to do here, anyway.
I can't recall the exact method that I've used in the past, but I know that I can work around this by piping netbootxyz-web.js through a shell script before it is served out by Apache. Nevertheless, anyone else that would like to reverse-proxy netbootxyz would likely bump into this issue, so it's worth mentioning. I will continue to work on this as time permits and post any findings.
Here are the relevant sections of my configurations.
Hello,
I am attempting to run docker-netbootxyz behind a reverse proxy so that I can have the administrative interface located at http://example.com/netbootxyz and the assets at http://example.com/assetsxyz. I am running netbootxyz as a Docker Stack (not just a service), with host-based rather than overlay networking which is better for maintaining stateful connections, and I use HAProxy and Apache to accomplish the reverse proxying.
Setting it up this way mostly seems to work just fine except that the webpage never progresses past saying "Getting Dashboard" with a pulsating disc, at which time I see this in Chrome's debugging console:
If I then examine netbootxyz-web.js, the issue is plainly obvious at line 9. As you will notice in my Apache configuration, I have attempted to remedy the situation by adding the line
ProxyHTMLURLMap /socket.io /netbootxyz/socket.io
, which has no effect becauseProxyHTMLURLMap
evidently does not have the proper context to match that line, so"/socket.io"
never gets modified, and it looks like it's the wrong thing to do here, anyway.I can't recall the exact method that I've used in the past, but I know that I can work around this by piping netbootxyz-web.js through a shell script before it is served out by Apache. Nevertheless, anyone else that would like to reverse-proxy netbootxyz would likely bump into this issue, so it's worth mentioning. I will continue to work on this as time permits and post any findings.
Here are the relevant sections of my configurations.
docker-compose.yaml
haproxy.cfg
extra/proxy-html.conf