certidude/certidude/templates/nginx.conf

47 lines
1.0 KiB
Nginx Configuration File
Raw Normal View History

2015-08-13 08:11:08 +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
root {{static_path}};
location /api/ {
2017-04-13 15:19:26 +00:00
proxy_pass http://127.0.0.1{% if listen != 80 }:{{ listen }}{% endif %}/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
}
{% if not push_server %}
location ~ "^/lp/pub/(.*)" {
allow 127.0.0.1;
nchan_publisher;
nchan_channel_id $1;
nchan_message_buffer_length 0;
}
2015-08-13 08:11:08 +00:00
location ~ "^/ev/pub/(.*)" {
allow 127.0.0.1;
nchan_publisher;
nchan_channel_id $1;
nchan_message_buffer_length 0;
2015-08-13 08:11:08 +00:00
}
location ~ "^/lp/sub/(.*)" {
nchan_channel_id $1;
nchan_subscriber longpoll;
}
location ~ "^/ev/sub/(.*)" {
nchan_channel_id $1;
nchan_subscriber eventsource;
}
{% endif %}
2015-08-13 08:11:08 +00:00
}