R
R
rysev-a2015-04-24 13:46:53
Network administration
rysev-a, 2015-04-24 13:46:53

How to run multiple sites on VDS?

There is a VDS on which I installed nginx (launched a site on gunicorn + flask)
How to run several sites on one VDS?
I want to run nginx using virtual hosts, this is how the setup for an existing site looks like

server {
  listen 80;
  server_name mikhailvideo.ru;

  root /home/alex/www;

  location / {
    proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    if (!-f $request_filename) {
      proxy_pass http://127.0.0.1:8000;
      break;
    }
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-04-24
@butteff

What OS is on the server?
You need to set up virtual hosts, all configs and manuals are easy to google.
But the paths depend on the OS in many ways. I wrote an article about the apache + nginx bundle for ubuntu , it may come in handy.
In your case, you need to search for "nginx virtualhosts osname".
Often, on VPS accounts, they give access to panels where all this can be simply created in the panels in two clicks, without delving into the configs. It's not a very good way, but it works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question