-
Notifications
You must be signed in to change notification settings - Fork 116
Allow base path changes #185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Do you have a proxy in front of broadcast box? Is it possible to rewrite the URLs in that? The network test would still work also. It should hit Broadcast Box instead of proxy. If we can't make it work I would love to land the PR! I just want to push off complexity (if possible) |
Nginx may rewrite in the forwards direction, but I wouldn't be able to host any other app at /api |
Hello. I'v tried to run broadcast-box with your commit with BASE_PATH="test123" and BASE_PATH="" in .env.production. In both cases i'v got "404 page not found" text with black blank screen in browser. In the first case with address "http://my_ip:8080/test123" and in the second with "http://my_ip:8080/". By checkout to previous version, removing BASE_PATH and rebuilding the project i'm getting normal broadcast-box web page, which works fine. Additionally if i enable NETWORK_TEST_ON_START, i get the following on start:
Can you advise what I'm doing wrong? P.S. My env file when error occurs:
|
I lost interest in completing this draft for a while, but @mauveferret does any other path apart from the base URL also error? |
Frankly speaking, I also lost interest after solving my task with the restreamer project. However, with it I also initially encountered the problem that not all links were redirected correctly. I was able to solve the problem by writing an additional redirect in nginx. The same recipe helped here with broadcast-box. Thus, I successfully launched your version of a broadcast box with the following .env.production file:
So, it turned out that the path needed to be changed also in REACT_APP_API_PATH variable. Additionally, i noticed variable PUBLIC_URL in the source code, which is not mentioned in docs, but i have not succeeded with it. It seems this variable influences logs during building: "The project was built assuming it is hosted at PUBLIC_URL". So by default i see "The project was built assuming it is hosted at /.". Then, my nginx config for broadcast-box looks as:
So, my initial problem with launching your rep was due to broken links like "my_external_url/static/js/..." instead of "my_external_url/test123/static/js/...", as was seen in web browser console. After adding the block for static in nginx config everything worked fine, so i could publish stream and watch it by "https://my_external_url/test123/some_streaming_key". Unfortunately, I'm a complete lamer in this, but perhaps some paths in the js sources are hardcoded? Or am I initially writing the config incorrectly? However, i can say that with the settings provided it works fine in chrome and edge browser. Additionally, i noticed that it does not work in firefox and android. |
If this would help anyone else I would be happy to merge/bring this PR back! Maybe we could do this at runtime though? Detect the suffix of the request. It would be nice when setting up Broadcast Box to do the least amount of work possible. |
I haven't had a chance to fully smoke test this, but it seemingly works, apart from connectivity issues.