setting up mender 1.6.0 and API Gateway

105 views
Skip to first unread message

hunter hu

unread,
Oct 25, 2018, 3:41:29 PM10/25/18
to Mender List mender.io
Hi,

I am trying to upgrade to mender 1.6.0, and encountered "502 bad gateway" when trying to connect to the mender server.

According to 1.6.0 documentation, "Production Installation" -> "API gateway", I have to

    mender-api-gateway:
        ...
        environment:
            ALLOWED_HOSTS: mender.example.com

in production/prod.yml.

But when I trying to connect to the server through IP address like this, my mender server is at: 192.168.1.205, 


 it gave me "502 bad gateway" error.  I have read that the new security measure in 1.6.0

"For security purposes, the gateway must know precisely the DNS name allocated to it, which you'll configure via the ALLOWED_HOSTS environment variable."

I have done the mender-api-gateway inside prod.yml, but still get the error, Do I need to do anything else to make it work in my network environment setup? or Do I miss anything?

Thanks,
Hunter

hunter hu

unread,
Oct 26, 2018, 11:04:45 AM10/26/18
to Mender List mender.io
I have figured out what is happening.

I was using the oldest 1.1.3 mender server, and that was the only version that doesn't have the mender-api-gateway configuration, and it was working fine.

Since version 1.2.2, mender-api-gateway has been added for more security, it won't work if there is no DNS server running that translates mender.example.com, hence the "502 bad gateway" error.

Since I am testing mender within my local LAN network, after I set up a DNS server that has the entry for mender.example.com, everything is working fine. 

Hope this helps someone too.

-Hunter

Mirza Krak

unread,
Oct 28, 2018, 4:49:43 PM10/28/18
to Mender List mender.io
On Fri, Oct 26, 2018 at 5:04 PM hunter hu <hunte...@gmail.com> wrote:
I have figured out what is happening.

I was using the oldest 1.1.3 mender server, and that was the only version that doesn't have the mender-api-gateway configuration, and it was working fine.

Since version 1.2.2, mender-api-gateway has been added for more security, it won't work if there is no DNS server running that translates mender.example.com, hence the "502 bad gateway" error.

Since I am testing mender within my local LAN network, after I set up a DNS server that has the entry for mender.example.com, everything is working fine. 

Hope this helps someone too.

Thanks for sharing back to the community!

-- 
Mirza Krak | Embedded Solutions Architect | https://mender.io

 Northern.tech AS | @northerntechHQ




Reply all
Reply to author
Forward
0 new messages