mirror of https://github.com/OpenVidu/openvidu.git
deployment: separated rules for dashboard/ and inspector/ in openvidu-proxy
To fix a rule in OpenVidu Enterprise to redirect `<domain>/inspector` to `<domain>/inspector/`, now dashboard and inspector rules are separated to have different configurations depending on the OpenVidu Edition PRO or Enterprisepull/809/head
parent
fb6df7773a
commit
946be88928
|
@ -1,6 +1,8 @@
|
|||
#################################
|
||||
# Common rules Enterprise #
|
||||
#################################
|
||||
{dashboard_inspector_rules_enterprise}
|
||||
|
||||
location /minio/ {
|
||||
{rules_access_dashboard}
|
||||
deny all;
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
location /dashboard {
|
||||
{rules_access_dashboard}
|
||||
deny all;
|
||||
rewrite ^/dashboard/(.*)$ /$1 break;
|
||||
proxy_pass http://openviduserver/;
|
||||
}
|
||||
|
||||
location /inspector {
|
||||
{rules_access_dashboard}
|
||||
deny all;
|
||||
rewrite ^([^.]*[^/])$ $1/ permanent;
|
||||
proxy_pass http://openviduserver;
|
||||
}
|
|
@ -1,18 +1,7 @@
|
|||
#################################
|
||||
# Common rules PRO #
|
||||
#################################
|
||||
location /dashboard {
|
||||
{rules_access_dashboard}
|
||||
deny all;
|
||||
rewrite ^/dashboard/(.*)$ /$1 break;
|
||||
proxy_pass http://openviduserver/;
|
||||
}
|
||||
|
||||
location /inspector {
|
||||
{rules_access_dashboard}
|
||||
deny all;
|
||||
proxy_pass http://openviduserver;
|
||||
}
|
||||
{dashboard_inspector_rules_pro}
|
||||
|
||||
location /kibana {
|
||||
{rules_access_dashboard}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
location /dashboard {
|
||||
{rules_access_dashboard}
|
||||
deny all;
|
||||
rewrite ^/dashboard/(.*)$ /$1 break;
|
||||
proxy_pass http://openviduserver/;
|
||||
}
|
||||
|
||||
location /inspector {
|
||||
{rules_access_dashboard}
|
||||
deny all;
|
||||
proxy_pass http://openviduserver;
|
||||
}
|
|
@ -296,7 +296,10 @@ elif [[ "${REDIRECT_WWW}" == "false" ]]; then
|
|||
sed -i '/{redirect_www_ssl}/d' /etc/nginx/conf.d/*
|
||||
fi
|
||||
|
||||
if [[ "${PROXY_MODE}" == "ENTERPRISE_HA" ]]; then
|
||||
if [[ "${PROXY_MODE}" == "PRO" ]]; then
|
||||
# Add dashboad and inspector rules
|
||||
sed -e '/{dashboard_inspector_rules_pro}/{r default_nginx_conf/global/pro/dashboard_inspector_rules_pro.conf' -e 'd}' -i /etc/nginx/conf.d/*
|
||||
elif [[ "${PROXY_MODE}" == "ENTERPRISE_HA" ]]; then
|
||||
TEMP_FILE_UPSTREAM=$(mktemp)
|
||||
|
||||
# Create upstream nodes
|
||||
|
@ -318,6 +321,12 @@ if [[ "${PROXY_MODE}" == "ENTERPRISE_HA" ]]; then
|
|||
|
||||
# Add upstream nodes to nginx config
|
||||
sed -e '/{enterprise_ha_nodes_upstream}/{r '"${TEMP_FILE_UPSTREAM}"'' -e 'd}' -i /etc/nginx/conf.d/*
|
||||
|
||||
# Add dashboad and inspector rules
|
||||
# 1. First remove pro rules
|
||||
sed -i '/{dashboard_inspector_rules_pro}/d' /etc/nginx/conf.d/*
|
||||
# 2. Add enterprise rules
|
||||
sed -e '/{dashboard_inspector_rules_enterprise}/{r default_nginx_conf/global/enterprise-ha/dashboard_inspector_rules_enterprise.conf' -e 'd}' -i /etc/nginx/conf.d/*
|
||||
fi
|
||||
|
||||
# Process main configs
|
||||
|
|
Loading…
Reference in New Issue