%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /etc/ansible/roles/web/templates/nginx/
Upload File :
Create Path :
Current File : //etc/ansible/roles/web/templates/nginx/http_balancer.conf.j2

## {{ ansible_managed }}
## load balancer for bx_cluster
## bx_cluster = upstream for all web nodes
## bx_local   = upstream with one local node
server {
  listen			80 default_server;
  server_name		_;
  server_name_in_redirect	off;

  access_log /var/log/nginx/balancer_access.log balancer;
  error_log  /var/log/nginx/balancer_error.log  warn;

  proxy_set_header X-Real-IP          $remote_addr;
  proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
  proxy_set_header Host               $host:80;
  proxy_set_header X-Forwarded-Host   $host;
  proxy_set_header X-Forwarded-Scheme $scheme;

	# Redirect to ssl if need
	if (-f /home/bitrix/www/.htsecure) {
		rewrite ^(.*)$ https://$host$1 permanent;
	}

	# Redirect requests to server pool
	location / {
		proxy_pass  http://bx_cluster;
	}

  # location for cluster module - test apache status (really need?)
	location ^~ /server-status$ {
		proxy_pass http://bx_local;
	}

  # monitoring locations - nagios
  location ^~ /nagios {
    proxy_pass http://bx_local;
  }

  # monitoring locations - munin
  location ^~ /munin {
    proxy_pass http://bx_local;
  }

  # scale module location
  location ~* ^/bitrix/admin/scale_.+\.php$ {
    proxy_pass http://bx_local;
  }

}

Zerion Mini Shell 1.0