3

我已经安装了 API Manager 1.6.0 并且 API Manager 也在运行。但是问题是商店中显示的 IP 地址是服务器的私有 IP。私有 IP 通过 VPN 访问。

以下是商店中显示为生产和沙盒 URL 的 URL,

http://192.168.6.162:8280/railway/2.0

对于 192.168.6.162,我分配了一个公共 IP,它也103.11.35.xx分配了一个域my-domain-name

我想看到的是如下,

http://my-domain-name/railway/2.0

如何配置 API Manager 以显示域名而不是带有端口的 IP 地址?

4

3 回答 3

7

您可以从 api-manager.xml 进行设置。在 APIGateway 部分下有 GatewayEndpoint 元素,您可以在其中指定应在商店中显示的 URL。

<APIGateway>

<Environments>
            <Environment type="hybrid">
                    <Name>Production and Sandbox</Name>
                    <ServerURL>https://localhost:9445/services/</ServerURL>
                    <Username>admin</Username>
                    <Password>admin</Password>
    **<GatewayEndpoint>http://localhost:8282,https://localhost:8245</GatewayEndpoint>**
            </Environment>
    </Environments>

    <EnableGatewayKeyCache>true</EnableGatewayKeyCache>

<ClientDomainHeader>referer</ClientDomainHeader>

</APIGateway>
于 2014-04-08T11:09:47.510 回答
1

编辑位于 WSO2-HOME/repository/conf 中的 api-manager.xml 文件,并将 GatewayEndpoint 设置为http://mydomainname.com

<Environment type="hybrid">
                    <Name>Production and Sandbox</Name>

                    <ServerURL>https://${carbon.local.ip}:${mgt.transport.https.port}/services/</ServerURL>

                    <Username>admin</Username>

                    <Password>admin</Password>

                    <GatewayEndpoint>http://${carbon.local.ip}:${http.nio.port},https://${carbon.local.ip}:${https.nio.port}</GatewayEndpoint>
            </Environment>
于 2014-04-09T06:38:37.407 回答
0

下面的配置对我有用。

您还可以使用 Ws02 API Manager DNS 条目或系统公共 IP 地址更改 carbon.xml 中的主机名值。

"<HostName>{hostname}</HostName>"

https://docs.wso2.com/display/AM210/Changing+the+Hostname

于 2019-02-09T17:46:44.270 回答