2015-08-13 08:11:08 +00:00
|
|
|
|
2016-03-29 19:03:27 +00:00
|
|
|
server {
|
|
|
|
server_name {{ common_name }};
|
|
|
|
listen 80 default_server;
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
2015-08-13 08:11:08 +00:00
|
|
|
|
2016-03-29 19:03:27 +00:00
|
|
|
root {{static_path}};
|
|
|
|
|
|
|
|
location /api/ {
|
2016-09-17 21:00:14 +00:00
|
|
|
proxy_pass http://127.0.0.1/api/;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_connect_timeout 600;
|
|
|
|
proxy_send_timeout 600;
|
|
|
|
proxy_read_timeout 600;
|
|
|
|
send_timeout 600;
|
2015-08-13 08:11:08 +00:00
|
|
|
}
|
|
|
|
|
2016-03-29 19:03:27 +00:00
|
|
|
{% if not push_server %}
|
|
|
|
location /pub {
|
|
|
|
allow 127.0.0.1;
|
|
|
|
nchan_publisher http;
|
|
|
|
nchan_store_messages off;
|
|
|
|
nchan_channel_id $arg_id;
|
|
|
|
}
|
2015-08-13 08:11:08 +00:00
|
|
|
|
2016-03-29 19:03:27 +00:00
|
|
|
location ~ "^/lp/(.*)" {
|
|
|
|
nchan_subscriber longpoll;
|
|
|
|
nchan_channel_id $1;
|
2015-08-13 08:11:08 +00:00
|
|
|
}
|
2016-03-29 19:03:27 +00:00
|
|
|
|
|
|
|
location ~ "^/ev/(.*)" {
|
|
|
|
nchan_subscriber eventsource;
|
|
|
|
nchan_channel_id $1;
|
|
|
|
}
|
|
|
|
{% endif %}
|
|
|
|
|
2015-08-13 08:11:08 +00:00
|
|
|
}
|
|
|
|
|