Reverbrain wiki

Site Tools


thevoid:nginx

thevoid as nginx's upstream

Let's look at simple nginx configuration file:

/etc/nginx/sites-enabled/example.conf
upstream example_server {
        server unix:/var/run/example/connection.sock;
        server 127.0.0.1:8080;
        keepalive 1024;
}
 
server {
        listen 80 default backlog=102400;
 
        location / {
                proxy_pass http://example_server;
                proxy_http_version 1.1;
                proxy_set_header Connection keep-alive;
        }
}

This section provides information about sockets thevoid listens, so nginx could proxy all requests to them. For more information have a look at nginx documentation.

upstream example_server {
        server unix:/var/run/example/connection.sock;
        server 127.0.0.1:8080;
        keepalive 1024;
}

Following section describes nginx behaviour.

  • proxy_pass must be linked to the upstream.
  • proxy_http_version and proxy_set_header are configured for forced keep-alive connection between nginx and thevoid
server {
        listen 80 default backlog=102400;
 
        location / {
                proxy_pass http://example_server;
                proxy_http_version 1.1;
                proxy_set_header Connection keep-alive;
        }
}

Rift

If you want to configure nginx as balancing server to access elliptics, you can check how to configure Rift server

thevoid/nginx.txt ยท Last modified: 2013/12/06 21:19 by zbr