我想使用具有以下位置的反向代理服务器访问 wso2apim。
https://wso2am:9443/carbon ---> https://nginx-ip/wso2am/carbon
我已经使用以下 URL 配置了 wso2am/store 和 wso2am/publisher。 https://docs.wso2.com/display/AM210/Configuring+the+Proxy+Server+and+the+Load+Balancer#ConfiguringtheProxyServerandtheLoadBalancer-Step1-CreateaSSLcertificatefortheloadbalancer
我的 nginx 配置如下:
location /wso2am/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass https://wso2am-host:wso2am-ip/;
proxy_redirect https://$http_host/carbon/carbon/ /wso2am/carbon/;
proxy_redirect https://$http_host/wso2am/ /wso2am/;
proxy_redirect https://$http_host/ /wso2am/;
proxy_redirect https://$http_host/store/ /wso2am/store/;
proxy_redirect https://$http_host/publisher/ /wso2am/publisher/;
proxy_cookie_path / /wso2am/;
}
但在配置并访问它之后,我登录到https://nginx-ip/wso2am/carbon。然后,登录后,如果我点击任何地方,我就会被注销。
有人可以协助我进行配置吗?
答案1
我遇到了同样的问题wso2am和wso2ei。我非常确定我们需要/repository/conf/carbon.xml
在此部分进行编辑(我必须承认评论并不十分清楚):
<!--
Webapp context root of WSO2 Carbon management console.
-->
<WebContextRoot>/wso2am</WebContextRoot>
<!--
Proxy context path is a useful parameter to add a proxy path when a Carbon server is fronted by reverse proxy. In addition
to the proxy host and proxy port this parameter allows you add a path component to external URLs. e.g.
URL of the Carbon server -> https://10.100.1.1:9443/carbon
URL of the reverse proxy -> https://prod.abc.com/appserver/carbon
appserver - proxy context path. This specially required whenever you are generating URLs to displace in
Carbon UI components.
-->
<MgtProxyContextPath>/</MgtProxyContextPath>
<ProxyContextPath>/wso2am</ProxyContextPath>
如果您的 Nginx 在 SSL 模式下监听 443,则以下方法有效(由于重定向,无法使用 HTTP 执行此操作 -> 如果您打算在本地网络上使用它,请制作自签名证书)
location /wso2am {
proxy_pass https://wso2_apimanager_container:9443;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_ssl_verify off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
它确实有效,但我并不完全清楚为什么。有人能向我解释一下和 的<MgtProxyContextPath>
区别吗?</MgtProxyContextPath>
<WebContextRoot>
子公司:有没有办法用 HTTP 而不是 HTTPS 来访问 carbon,并让 Nginx 处理证书(在我的例子中可能会简化集成)