我已经安装了API管理1.6.0,并获得API管理运行也是如此。然而问题是商店中显示的IP地址是服务器的私有IP。私有IP通过VPN访问。
下面是该商店中显示的生产和沙盒网址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管理器显示的域名,而不是与端口的IP地址?
您可以从API-manager.xml设置此。在APIGateway部分有在其中您可以指定要在商店中显示的网址的GatewayEndpoint元素。
<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>
位于WSO2-HOME /库/ 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>
下面的配置为我工作。
您还可以更改carbon.xml hostname值与WS02 API经理DNS条目或系统的公共IP地址。
"<HostName>{hostname}</HostName>"