MRS 集群 Manager 页面使用域名访问
在云上使用MRS集群时,经常会访问集群的manager页面和组件的原生页面,MRS当前提供的方案是使用EIP进行访问。本文提供一种使用域名访问MRS集群的方法。
1:前置条件
1)MRS集群已开通
2)集群绑定有EIP,或者有专线可以与集群互通
3)部署有Nginx,DNS
4)有一个域名
2:Nginx配置
本文给出一个配置样例
upstream yourdoaminname {
server 集群OMS IP:9022(或者EIP);
}
location /mrsmanager {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass https://yourdoaminname/mrsmanager;
proxy_http_version 1.1;
proxy_set_header Connection "";
#include cloudbiips.conf;
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Credentials "true";
}
location /mrscas {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass https://yourdoaminname/mrscas;
proxy_http_version 1.1;
proxy_set_header Connection "";
#include cloudbiips.conf;
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Credentials "true";
}
location /component {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass https://yourdoaminname/component;
proxy_http_version 1.1;
proxy_set_header Connection "";
#include cloudbiips.conf;
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Credentials "true";
}
location /gateway/mrsweb/mrsmanager {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass https://yourdoaminname/gateway/mrsweb/mrsmanager;
proxy_http_version 1.1;
proxy_set_header Connection "";
#include cloudbiips.conf;
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Credentials "true";
}
3:配置好后,重启nginx
4:页面输入域名url即可以访问集群了
- 点赞
- 收藏
- 关注作者
评论(0)