-
Notifications
You must be signed in to change notification settings - Fork 7
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
Allow changing the path/subfolder of the application #35
Comments
As mentioned in #32 there is cleaner workaround that does not imply to change the core, by adding another nginx location configuration. Let's keep that open, but it implies two important aspects:
|
Hi, The issue has been fixed in e9312e9, and released in So, there is a new config option With a soundworks config file (e.g.
We can thus have an nginx config such as:
Existing applications and nginx config should still work as expected without modifications. I also updated the template to get rid of all references to Cheers, |
Also added a documentation page there https://collective-soundworks.github.io/misc/online-deployment.html |
Issue: This refers to example [1] specified below. When the application is available with an appended path, the path needs to be configured somehow.
Usually, the full request path is handed to the application, in [1] this would be e.g.
soundworks/controller
but the application itself is only handling paths without the leading (subfolder) path such ascontroller
. There is a workaround by removing the prefixes via the nginx config. This leads to a working application (without working websockets). However, this is also not specifiable (if this is a word) in the configuration: If I don't set a specificpath
for the sockets (default issocket
) in the configuration of soundworks, then the request for the socket will be send onwss://example.com/socket
, which is obviously not available. If I add the full pathsoundworks/socket
, the request will be handled and upgrade by the webserver (http->ws), but in the scope of the scenario in 1), this request will also be stripped: This is due to the fact, that the websockets requests are forwardedcorrectly
by the webserver e.g.wss://example.com/soundworks/socket
, the corresponding request in the application will be/socket
. This is not matching the expected schema and opened sockets which are running on/soundworks/socket
.Without dropping the prefixes, the requests like
example.com/soundworks/controller
will be internally forwarded by ngnix to127.0.0.1:8000
with the pathsoundworks/controller
, which return obviously a 404 because only/player
and/controller
are specified by default.Workaround for 1): I solved this by modifying the soundworks/core code. What I did is hardcoding the
socket
path instead of using the full path from the configuration (which would be/soundworks/socket
). To modification are made here: https://github.com/collective-soundworks/soundworks/blob/master/src/server/Sockets.js#L37What would be useful: It would be useful to specify a subfolder/request path of the application manually in the configuration. This would help to overcome the modifications and configuration issues named above. The application handling/routing internally could then work without that overhead.
[1] Example:
example.com
example.com/soundworks
127.0.0.1:8000
/soundsworks
are configured to be internally redirected to127.0.0.1:8000
The text was updated successfully, but these errors were encountered: