How to deploy mupx multi site in single vps?

dear everyone !

i tried setup & deploy with:

  "env": {
    "PORT": 3000,
    "ROOT_URL": "http://www.mydomain.com"
  },

when run app, it will start at: http://www.mydomain.com:3000
so i install new nginx ( server does not have this yet )

sudo apt-get install nginx

and add this config to sites-available: mydomain.com.conf

    server {
      listen *:80;
      server_name  mydomain.com;
      return 301 $scheme://www.mydomain.com$request_uri;
    }

    server {
      listen                *:80;

      server_name           www.mydomain.com;

      access_log            /var/log/nginx/app.dev.access.log;
      error_log             /var/log/nginx/app.dev.error.log;

      location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header X-Forwarded-For $remote_addr;
      }
    }

i restarted nginx and reboot too, but still http://www.mydomain.com:3000
go to http://www.mydomain.com it is standard nginx welcome message.

what missing ? please help !

Not sure what you may be missing, but I’m pasting the conf I’ve used for over a year:

server {
        listen   80;
        server_name myapp.com;

        root /dev/null;

        location / {
                proxy_pass http://localhost:3000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
        }
}
1 Like

so we much install new nginx package for ubuntu and config like that @vigorwebsolutions ?
i see mupx use docker, but i dont know it have exist nginx or we must install new ?

I can only tell you what I’ve been using in my environments.

I’ve used nginx (and that configuration) with mup and mupx, both in Ubuntu droplets, and I’ve always installed nginx.

1 Like

ya, i’m missing for does not remove sites-available/default config file yet. it will receive port 80, and other config not happend… omg :blush:

You shouldn’t be going to: http://www.mydomain.com:3000
But rather: http://www.mydomain.com

edit: ahh looks like you hadn’t removed the default config yet, either way, the point i made still stands. but i suspect you just made a typo

1 Like

@cstrat my english is too bad :smile:

1 Like