blob: f8be5c0ef54610dd87fe0329a1fa07e6af28cccd [file] [log] [blame]
# *****************************************************************************
#
# Copyright (c) 2016, EPAM SYSTEMS INC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ******************************************************************************
location /{{ CLUSTER_NAME }}/ {
rewrite ^/{{ CLUSTER_NAME }}/(.*)$ /$1 break;
proxy_pass http://{{ MASTER_IP }}:8080;
proxy_redirect http://{{ MASTER_IP }}:8080/ $scheme://$host/{{ CLUSTER_NAME }}/;
proxy_set_header Accept-Encoding "";
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
sub_filter_types *;
sub_filter_once off;
sub_filter '/static/' '/{{ CLUSTER_NAME }}/static/';
sub_filter '/app/' '/{{ CLUSTER_NAME }}/app/';
sub_filter '<a href="/"' '<a href="/{{ CLUSTER_NAME }}/"';
sub_filter '//{{ MASTER_DNS }}:7077' '//$host/{{ CLUSTER_NAME }}-client-master';
sub_filter '//{{ MASTER_DNS }}:6066' '//$host/{{ CLUSTER_NAME }}-cluster-master';
sub_filter '//{{ NOTEBOOK_IP }}:4040' '//$host/{{ CLUSTER_NAME }}-driver';
sub_filter '//{{ MASTER_IP }}:8081' '//$host/{{ CLUSTER_NAME }}-master-datanode';
{% for item in slaves %}
sub_filter '//{{ item.ip }}:8081' '//$host/{{ CLUSTER_NAME }}-{{ item.name }}';
{% endfor %}
}
location /{{ CLUSTER_NAME }}-client-master/ {
rewrite ^/{{ CLUSTER_NAME }}-client-master/(.*)$ /$1 break;
proxy_pass http://{{ MASTER_IP }}:7077;
proxy_redirect http://{{ MASTER_IP }}:7077/ $scheme://$host/{{ CLUSTER_NAME }}-client-master/;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
sub_filter '<a href="/"' '<a href="/{{ CLUSTER_NAME }}/"';
}
location /{{ CLUSTER_NAME }}-cluster-master/ {
rewrite ^/{{ CLUSTER_NAME }}-cluster-master/(.*)$ /$1 break;
proxy_pass http://{{ MASTER_IP }}:6066;
proxy_redirect http://{{ MASTER_IP }}:6066/ $scheme://$host/{{ CLUSTER_NAME }}-cluster-master/;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /{{ CLUSTER_NAME }}-driver/ {
rewrite ^/{{ CLUSTER_NAME }}-driver/(.*)$ /$1 break;
proxy_pass http://{{ NOTEBOOK_IP }}:4040;
proxy_redirect http://{{ NOTEBOOK_IP }}:4040/ $scheme://$host/{{ CLUSTER_NAME }}-driver/;
proxy_set_header Accept-Encoding "";
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
sub_filter_types *;
sub_filter_once off;
sub_filter '<a href="/"' '<a href="/{{ CLUSTER_NAME }}/"';
sub_filter '/jobs/' '/{{ CLUSTER_NAME }}-driver/jobs/';
sub_filter '/static/' '/{{ CLUSTER_NAME }}-driver/static/';
sub_filter '/stages/' '/{{ CLUSTER_NAME }}-driver/stages/';
sub_filter '/storage/' '/{{ CLUSTER_NAME }}-driver/storage/';
sub_filter '/environment/' '/{{ CLUSTER_NAME }}-driver/environment/';
sub_filter '/executors/' '/{{ CLUSTER_NAME }}-driver/executors/';
sub_filter '/SQL/' '/{{ CLUSTER_NAME }}-driver/SQL/';
}
location /{{ CLUSTER_NAME }}-master-datanode/ {
rewrite ^/{{ CLUSTER_NAME }}-master-datanode/(.*)$ /$1 break;
proxy_pass http://{{ MASTER_IP }}:8081;
proxy_redirect http://{{ MASTER_IP }}:8081/ $scheme://$host/{{ CLUSTER_NAME }}-master-datanode/;
proxy_set_header Accept-Encoding "";
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
sub_filter_types *;
sub_filter_once off;
sub_filter '/static/' '/{{ CLUSTER_NAME }}-master-datanode/static/';
sub_filter '<a href="/"' '<a href="/{{ CLUSTER_NAME }}/"';
sub_filter '//{{ MASTER_DNS }}:7077' '//$host/{{ CLUSTER_NAME }}-client-master';
sub_filter '//{{ MASTER_DNS }}:8080' '//$host/{{ CLUSTER_NAME }}';
}
{% for item in slaves %}
location /{{ CLUSTER_NAME }}-{{ item.name }}/ {
rewrite ^/{{ CLUSTER_NAME }}-{{ item.name }}/(.*)$ /$1 break;
proxy_pass http://{{ item.ip }}:8081;
proxy_redirect http://{{ item.ip }}:8081/ $scheme://$host/{{ CLUSTER_NAME }}-{{ item.name }}/;
proxy_set_header Accept-Encoding "";
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
sub_filter_types *;
sub_filter_once off;
sub_filter '/static/' '/{{ CLUSTER_NAME }}-{{ item.name }}/static/';
sub_filter '<a href="/"' '<a href="/{{ CLUSTER_NAME }}/"';
sub_filter '//{{ MASTER_DNS }}:7077' '//$host/{{ CLUSTER_NAME }}-client-master';
sub_filter '//{{ MASTER_DNS }}:8080' '//$host/{{ CLUSTER_NAME }}';
}
{% endfor %}