WSO2 API Manager - Displaying Private IP in the store

天大地大妈咪最大 提交于 2019-12-22 10:58:08

问题


I have installed the API manager 1.6.0 and got API Manager running as well. However the problem is IP address shown within store is the private IP of the server. Private IP is accessed via a VPN.

Below is the URL which is shown in the store as Production and Sandbox URLs,

http://192.168.6.162:8280/railway/2.0

For 192.168.6.162 I have assigned a public IP which is 103.11.35.xx and assigned a domain my-domain-name as well.

What I would like to see is as below,

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

How can I configure API Manager to show the domain name instead of an IP address with a port?


回答1:


You can set this from api-manager.xml. Under APIGateway section there's the GatewayEndpoint element in which you can specify the URLs which should be shown in the store.

<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>



回答2:


Edit api-manager.xml file located in WSO2-HOME/repository/conf, and set the GatewayEndpoint to 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>



回答3:


Below Configuration worked for me.

You can also change the Hostname Value in carbon.xml with your Ws02 API Manager DNS entry or System Public IP address.

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

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



来源:https://stackoverflow.com/questions/22934401/wso2-api-manager-displaying-private-ip-in-the-store

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!