docker-apim icon indicating copy to clipboard operation
docker-apim copied to clipboard

API Manager Store using Docker container IP

Open f0nZ opened this issue 7 years ago • 3 comments

Description: While using docker in my machine, everything is ok, but I assume that's due to using 'localhost' ip. When I upload to a VPS, API Manager Store for some reason uses docker container ip instead my Azure machine IP. Takes a lot of time to load the page and most of it is broken because all images/api production and sandbox links all point to the docker container ip.

Edit: OK, while I was writing this I instantly fixed it...

If you run this project in your localhost machine, it's ok, but when you try to publish online you need to change a single line to fix any connectivity problem.

After API Manager deploys he creates this file (you need to docker exec to check this out): ..\wso2am-2.2.0\repository\deployment\jaggeryapps\store\site\conf\site.json

All you need to do is to change this line:

"whiteListedHostNames" : ["localhost"]

And change it considering your machine in the cloud is 53.42.13.23 or whatever:

"whiteListedHostNames" : ["localhost","53.42.13.23"]

If you had any broken image or url in API Manager Store, this will fix it, but still Production and Sandbox URLs will remain with docker container ip address. Will try to fix that too but you can just override it by swapping manually both ip's while making a call.

f0nZ avatar Jun 15 '18 14:06 f0nZ

:+1::+1::+1:

Valdanitooooo avatar Aug 22 '19 10:08 Valdanitooooo

Awesome @f0nZ , it makes a huge difference. Any findings on the broken links from API Console screen (from STORE)?

nasuc avatar Sep 06 '19 09:09 nasuc

@f0nZ great job, congrats

To change the IP in the console store replace the next lines in the file <APIM_HOME>/repository/conf/api-manager.xml

    <APIStore>
        <!--GroupingExtractor>org.wso2.carbon.apimgt.impl.DefaultGroupIDExtractorImpl</GroupingExtractor-->
        <!--This property is used to indicate how we do user name comparision for token generation https://wso2.org/jira/browse/APIMANAGER-2225-->
        <CompareCaseInsensitively>true</CompareCaseInsensitively>
        <DisplayURL>true</DisplayURL>
        <URL>https://localhost:${mgt.transport.https.port}/store</URL>

you can change localhost for you host ip

oscarvesga avatar Feb 07 '20 17:02 oscarvesga