Skip to content
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

use nginx to proxy browser request to collaboration-server service. #4225

Draft
wants to merge 2 commits into
base: test-collab
Choose a base branch
from

Conversation

apsinghdev
Copy link
Member

@chimosky I have commented out the previous code for now (to keep it just in case I need it later) but once I get your input on these new configurations, I'll clean things up.

@chimosky
Copy link
Member

chimosky commented Jan 4, 2025

Haven't tested this yet, I don't remember us agreeing to have an nginx service running together with other services.

@walterbender
Copy link
Member

nginx is an easy way to do this... any down side?

@chimosky
Copy link
Member

chimosky commented Jan 5, 2025

Yes, nginx is an easy way to do this, but we'll have one configuration on the server so we can run multiple containers and have it direct traffic where we want it to, having it as part of the services means any number of containers we decide to run will have their own configuration and that's not a great way to do this.

@apsinghdev
Copy link
Member Author

@chimosky I agree with you. In fact, I tried multiple ways to avoid using anything like Nginx. The problem is that we are trying to access the collaboration-server like this: http://collaboration-server:8080, and in this scenario, the browser can't get access to our service running inside the docker container.

To my knowledge, we'll have to port map music blocks to the host machine to use it, and to connect with collaboration-server, we can use an internal docker network. But, the whole music blocks code is client-side and renders in the browser so when it tries to connect with collaboration-server, it requests this http://collaboration-server:8080/socket.io/?EIO=4&transport=polling&t=PGeEUb8 and fails because of the already mentioned reasons.

If you have a better workaround for it other than using nginx, please let me know. I'd be happy to make the changes.

@chimosky
Copy link
Member

chimosky commented Jan 6, 2025

I noticed the issue with this earlier, couldn't figure out why and a possible solution, haven't tested your changes yet and I will.

If it fixes the issue then we can go with it, this would mean that the gateway to the services would be nginx and we can live with that.

@apsinghdev
Copy link
Member Author

I noticed the issue with this earlier, couldn't figure out why and a possible solution, haven't tested your changes yet and I will.

If it fixes the issue then we can go with it, this would mean that the gateway to the services would be nginx and we can live with that.

Yeah, I guess, we should go with this solution for now until we find a better one. Please test to your side whenever you get a chance and let me know your thoughts.

@chimosky
Copy link
Member

chimosky commented Jan 9, 2025

Tested your changes, it doesn't work as expected.

Musicblocks runs, but I don't get a prompt about collaboration, the collaboration-server service never starts up and this is seen in the logs;

npm error Missing script: "server"
npm error
npm error Did you mean this?
npm error   npm run serve # run the "serve" package script
npm error
npm error To see a list of scripts, run:
npm error   npm run
npm error A complete log of this run can be found in: /root/.npm/_logs/2025-01-09T17_16_06_540Z-debug-0.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants