M
M
mikemoix2015-08-13 11:50:22
Nginx
mikemoix, 2015-08-13 11:50:22

Setting up nginx with websocket?

There is a project on django+tornado. Django is just a project, but tornado is a websocket (for example, online quotes). I need to set up nginx in such a way that I can run several of these projects in parallel (they don't link and have slight differences).
For example:
one.domain.ru -> django_one (port 1)
ws.one.domain.ru -> tornado_one (port 11)
two.domain.ru -> django_two (port 2)
ws.two.domain.ru -> tornado_two (port 22)
I haven't decided to use uwsgi yet (well, I can't set it up because of the crookedness of my hands)
What can I do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav, 2015-08-13
@mikemoix

In its simplest form, it will be something like this, if I'm not mistaken.

server {
  server_name ws.one.domain.ru;
  location / {
    proxy_pass http://localhost:11;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question