
Support Compass OpenStack installation with integrated PLUMgrid Open Networking Suite. PLUMgrid ONS is a comprehensive software-only networking solution for OpenStack which integrates with Neutron. The current implementation supports OpenStack Juno with a single controller. * add role for core plumgrid software * add role for plugin to neutron * add single-controller playbook to include plumgrid roles Change-Id: I4c320e9282bcafe450556e70020505fdb5aaf396
144 lines
4.1 KiB
Plaintext
144 lines
4.1 KiB
Plaintext
upstream sal {
|
|
server unix:/opt/pg/tmp/sal-web.socket;
|
|
keepalive 16;
|
|
}
|
|
|
|
upstream websocket {
|
|
server unix:/opt/pg/tmp/sal-ws.socket;
|
|
keepalive 16;
|
|
}
|
|
|
|
upstream pgCli {
|
|
server {{ nginx_virtual_ip }}:3000;
|
|
}
|
|
|
|
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
lua_socket_log_errors off;
|
|
#lua_code_cache off;
|
|
lua_shared_dict rest_servers 16K;
|
|
lua_shared_dict apache_servers 16K;
|
|
lua_shared_dict tc_servers 16K;
|
|
init_by_lua 'lb = require "lb"
|
|
init_servers = {
|
|
["{{ real1 }}"] = true,
|
|
{% if real2 is defined %}
|
|
["{{ real2 }}"] = true,
|
|
{% endif %}
|
|
{% if real3 is defined %}
|
|
["{{ real3 }}"] = true,
|
|
{% endif %}
|
|
}';
|
|
|
|
# Redirect http to https
|
|
server {
|
|
listen {{ nginx_virtual_ip }}:9080;
|
|
server_name $hostname;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen {{ nginx_virtual_ip }}:443 ssl;
|
|
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
|
|
ssl_ciphers AES128-SHA:AES256-SHA:RC4-SHA:DES-CBC3-SHA:RC4-MD5;
|
|
ssl_certificate /opt/pg/sal/nginx/ssl/default.crt;
|
|
ssl_certificate_key /opt/pg/sal/nginx/ssl/default.key;
|
|
#ssl_session_cache shared:SSL:10m;
|
|
#ssl_session_timeout 10m;
|
|
|
|
server_name $hostname;
|
|
root /opt/pg/web;
|
|
index login.html;
|
|
|
|
location /cli/ {
|
|
proxy_pass http://pgCli/;
|
|
proxy_redirect off;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
}
|
|
|
|
location /vtap/ {
|
|
alias /opt/pg/vtap;
|
|
}
|
|
|
|
# REST API calls start with /v[0-9]/, a keyword, or a capital letter.
|
|
# Note: Regular expressions have higher precedence than prefix matches
|
|
# so don't combine with /0/...
|
|
location ~ ^/(v[0-9]/|pg/|docs|api-docs|[A-Z]) {
|
|
set $active_upstream "http://sal";
|
|
access_by_lua 'if ngx.req.get_uri_args()["server"]~=nil then
|
|
if ngx.req.get_uri_args()["server"]~=ngx.var.host then
|
|
ngx.var.active_upstream = "https://"..ngx.req.get_uri_args()["server"]..ngx.var.request_uri
|
|
end
|
|
end';
|
|
|
|
proxy_pass $active_upstream;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
|
|
location /0/ {
|
|
set $active_upstream "http://sal";
|
|
access_by_lua 'if ngx.req.get_uri_args()["server"]~=nil then
|
|
if ngx.req.get_uri_args()["server"]~=ngx.var.host then
|
|
ngx.var.active_upstream = "https://"..ngx.req.get_uri_args()["server"]..ngx.var.request_uri
|
|
end
|
|
end';
|
|
|
|
proxy_pass $active_upstream;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
|
|
location /0/websocket {
|
|
set $active_upstream "http://websocket";
|
|
access_by_lua 'if ngx.req.get_uri_args()["server"]~=nil then
|
|
if ngx.req.get_uri_args()["server"]~=ngx.var.host then
|
|
ngx.var.active_upstream = "https://"..ngx.req.get_uri_args()["server"]..ngx.var.request_uri
|
|
end
|
|
end';
|
|
proxy_pass $active_upstream;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen unix:/opt/pg/tmp/sal-rest.socket;
|
|
|
|
# debug socket
|
|
listen 127.0.0.1:9080;
|
|
|
|
location / {
|
|
set $active_upstream "";
|
|
access_by_lua 'ngx.var.active_upstream = find_next(ngx.shared.rest_servers, {{ rest_port }})';
|
|
proxy_pass http://$active_upstream:{{ rest_port }};
|
|
}
|
|
|
|
location /_debug/rest_servers {
|
|
access_by_lua 'find_next(ngx.shared.rest_servers, {{ rest_port }})';
|
|
content_by_lua '
|
|
for _, ip in pairs(ngx.shared.rest_servers:get_keys()) do
|
|
ngx.say(ip.."="..ngx.shared.rest_servers:get(ip))
|
|
end
|
|
';
|
|
}
|
|
|
|
location /_debug/tc_servers {
|
|
access_by_lua 'find_next(ngx.shared.tc_servers, 12349)';
|
|
content_by_lua '
|
|
for _, ip in pairs(ngx.shared.tc_servers:get_keys()) do
|
|
ngx.say(ip.."="..ngx.shared.tc_servers:get(ip))
|
|
end
|
|
';
|
|
}
|
|
}
|