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

Don't use options object for listening on unix socket #2877

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

Tofandel
Copy link

This change is so nitro works on a passenger server with autoinstall turned on

https://www.phusionpassenger.com/library/indepth/nodejs/reverse_port_binding.html

The gist is that if we have multiple server.listen on passenger, we need to disable autoinstall and instead call server.listen('passenger', ...)

It is very important that the parameter is a string, it cannot be passed as an object like {path: 'passenger'} or {port: 'passenger'}, otherwise passenger doesn't pick up on it and instead the server will be registered on a unix socket passenger in the cwd

@Tofandel Tofandel requested a review from pi0 as a code owner November 13, 2024 14:50
@pi0
Copy link
Member

pi0 commented Nov 13, 2024

Thanks for your PR, dear @Tofandel. Since this preset is for Node.js and Node.js supports it I think we can keep it.

But I would be more than happy to create a dedicated preset for https://www.phusionpassenger.com/.

Can you please first open a discussion and perhaps share some steps how to create a Nitro deployment with phusionpassenger? 🙏🏼

@Tofandel
Copy link
Author

Tofandel commented Nov 13, 2024

Mm, passenger is still node under the hood and not really a dedicated runtime env so it wouldn't make much sense to duplicate all this and maintain a separate preset.

https://www.phusionpassenger.com/docs/tutorials/what_is_passenger/

It's a nginx extension (or apache) that then runs the node server on request and registers the server as a random unix socket which nginx then serves, normally if you don't have multiple server.listen then everything runs fine and passenger will edit the first call to server.listen and instead of registering with whatever you called it, it will register it on a unix socket but when you have multiple, then you need to explicitely say which server.listen call should be the one passenger hooks into using what I mentionned above and this is when you run into issues

Plesk comes with passenger by default for example and set's up everything for you: nginx passenger the node app and env

@pi0
Copy link
Member

pi0 commented Nov 13, 2024

I would highly appreciate if you can help on making reproduction steps for a problematic deployment first thing.

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.

2 participants