1#!/bin/sh #good enough highlighting
2worker_processes  16;
3worker_rlimit_nofile 150000;
4
5#error_log  /dev/stderr debug;
6error_log  /dev/stderr  notice;
7#error_log   err.log  notice;
8
9pid        /tmp/nchan-test-nginx.pid;
10daemon      off;
11
12events {
13  worker_connections  50000;
14}
15
16http {
17  #include       mime.types;
18  default_type  application/octet-stream;
19
20  nchan_max_reserved_memory 1024M;
21
22  access_log off;
23  sendfile on;
24  tcp_nopush on;
25  tcp_nodelay on;
26  keepalive_timeout 30s;
27  types_hash_max_size 2048;
28  client_max_body_size 10M;
29  server_tokens off;
30  gzip  on;
31
32  server {
33    listen 127.0.0.1:8083;
34    location ~ /action/pub/(\w+)$ {
35      nchan_publisher;
36      nchan_channel_id $1;
37      nchan_message_timeout 5s;
38      nchan_message_buffer_length 10;
39    }
40  }
41
42  server {
43    listen 127.0.0.1:8082;
44    location /action/subauth {
45      proxy_pass http://127.0.0.1:8053/subauth;
46      proxy_pass_request_body off;
47      proxy_set_header Content-Length "";
48      proxy_set_header X-Subscriber-Type $nchan_subscriber_type;
49      proxy_set_header X-Prev-Message-Id $nchan_prev_message_id;
50      proxy_set_header X-Channel-Id $nchan_channel_id;
51      proxy_set_header X-Original-URI $request_uri;
52      proxy_set_header X-Forwarded-For $remote_addr;
53    }
54    location ~ /action/sub/(\w+)$ {
55      nchan_subscriber;
56      nchan_channel_id $1;
57      nchan_authorize_request /action/subauth;
58      client_body_timeout 65;
59      keepalive_timeout 65;
60      send_timeout 60;
61    }
62  }
63}
64