Evan Carroll
Evan Carroll

Reputation: 1

What is the best way to set ports in PM2?

I'm unsure of the best way to set ports in PM2. I don't see this documented anywhere. I'm using a front-facing nginx server which listens on proxys to specific ports on the backend that represent the node servers. How do I best set this type of configuration up?

Upvotes: 0

Views: 333

Answers (1)

Evan Carroll
Evan Carroll

Reputation: 1

One method is with env in process.json

{
        "name"       : "MyApp",
        "script"     : "./MyApp/app.js",
        "instances"  : "1",
        "exec_mode"  : "cluster_mode",
        "env": {"PORT": 3030}
}

Upvotes: 1

Related Questions