I think this is something between feature request or bug
Describe The Bug:
Normally after setup will use http://ip:8080 to access the UI, but I have nginx reverse proxy to serve the site and setup http://ip/homebridge to access homebridge web UI. The UI will show a white blank screen.
The reason is all js and css are not loaded. /homebridge/ in the request path is missing.
=> http://ip/styles.e0dc902492593c470c22.css
should be
=> http://ip/homebridge/styles.e0dc902492593c470c22.css (will return 200)

I try to edit the index page, adding homebridge/ in all path:

but still, the same problem happens on other requests:
http://ip/api/auth/settings

If reverse proxy use root / to serve, the UI is working
Seems the UI is an Angular app, and it can be fix in code or build parameter?
http://www.projectcodify.com/angular-set-base-url-dynamically
https://stackoverflow.com/questions/55705637/how-to-set-base-url-for-angular-application
https://angular.io/api/common/APP_BASE_HREF
To Reproduce:
server{
listen 80;
location /homebridge {
proxy_pass http://127.0.0.1:8081/;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
}
}
http://ip/homebridgeExpected behavior:
Can access the UI by http://ip/homebridge/ like normal (or other paths in front)
(not related)
Homebridge Config:
(default config)
Screenshots:
Environment:
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
oznu/homebridge latest fba80728acfd 5 days ago 471MB
Here is what needs to change:
https://github.com/oznu/homebridge-config-ui-x/compare/url-stub-support
Not merging yes as I'm not sure it won't break existing setups.
I want to test it. How to update?
sudo npm install -g --unsafe-perm [email protected]
I updated.
css and js in index page are loading correctly, but /homebridge/api/auth/settings returns the index html.


Hi @oznu! I added 3 Nginx rewrite rule, it is working now!
rewrite /homebridge/api/(.*) /api/$1 break;
rewrite /homebridge/socket.io/(.*) /socket.io/$1 break;
rewrite /homebridge/platform-tools/docker/(.*) /$1 break;
Also tested it works without url stub.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.