colab.conf.erb 942 Bytes
upstream colab {
  server                127.0.0.1:8001  fail_timeout=10s;
}

server {
  listen                *:80;

  server_name           <%= node['config']['external_hostname'] %>;

  access_log            /var/log/nginx/colab.access.log;
  error_log             /var/log/nginx/colab.error.log;
  client_max_body_size  0;

  # FIXME: Favico should be at right place and this
  #     code should be removed.
  location ~ ^/static/img/fav\.[^.]+\.ico$ {
    alias /var/lib/colab/assets/spb/fav.ico;
  }

  location / {
    root  /var/lib/colab/assets/;
    try_files $uri @colab-app;
  }

  location @colab-app {
    proxy_pass              http://colab;
    proxy_read_timeout      90;
    proxy_connect_timeout   90;
    proxy_redirect          off;
    proxy_set_header        Host $host;
    proxy_set_header        X-Real-IP $remote_addr;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}

# vim: ft=nginx