# Ansible managed
server {
listen 8895 default_server;
server_name _;
# access_log /var/log/nginx/access.log main buffer=64k;
# access_log /dev/shm/access.log simple;
# error_log /var/log/nginx/error.log warn;
access_log off;
add_header "X-Content-Type-Options" "nosniff";
location /server-stat {
access_log off;
proxy_pass http://nodejs_pub;
}
location /nginx_status {
stub_status on;
}
location /bitrix/pub/ {
# IM doesn't wait
proxy_ignore_client_abort on;
proxy_pass http://nodejs_pub;
}
include bx/conf/im_subscrider.conf;
location / {
deny all;
}
}
server {
listen 8893;
listen 8894 default_server ssl;
access_log off;
add_header Access-Control-Allow-Origin *;
server_name _;
# ssl settings
include bx/conf/ssl.conf;
# Include error handlers
include bx/conf/errors.conf;
# Include im subscrider handlers
include bx/conf/im_subscrider.conf;
location / { deny all; }
}
# Nonsecure server for reading personal channels. Use secure server instead.
server {
# nginx-push-stream-module server for push & pull
listen 8893;
server_name _;
# Include error handlers
include bx/conf/errors.conf;
# Include im subscrider handlers
include bx/conf/im_subscrider.conf;
location / { deny all; }
}
# SSL enabled server for reading personal channels
server {
listen 8894 ssl;
server_name _;
include bx/conf/ssl-push.conf;
# Include error handlers
include bx/conf/errors.conf;
# Include im subscrider handlers
include bx/conf/im_subscrider.conf;
location / { deny all; }
}
# Server to push messages to user channels
server {
listen 127.0.0.1:8895;
server_name _;
location ^~ /bitrix/pub/ {
push_stream_publisher admin;
push_stream_channels_path $arg_CHANNEL_ID;
push_stream_store_messages on;
allow 127.0.0.0/8;
deny all;
}
location / { deny all; }
# Include error handlers
include bx/conf/errors.conf;
}
log_format simple '$time_local $status $request';
# if connection ti not set
map $http_upgrade $connection_upgrade {
default upgrade;
'' 'close';
}
map $http_upgrade $replace_upgrade {
default $http_upgrade;
'' "websocket";
}
# sub services
upstream nodejs_sub {
ip_hash;
keepalive 1024;
server bitrix.pool:8010;
server bitrix.pool:8011;
server bitrix.pool:8012;
server bitrix.pool:8013;
server bitrix.pool:8014;
server bitrix.pool:8015;
}
# pub services
upstream nodejs_pub {
ip_hash;
keepalive 1024;
server bitrix.pool:9010;
server bitrix.pool:9011;
}