Portal on https url

Imported Google Group message. Original thread at: Redirecting to Google Groups Import Date: 2016-01-19 21:37:29 +0000.
Sender:Tarmo Janson.
Date:Friday, 18 December 2015 13:17:30 UTC.

Hi,

I’m trying to make the dev portal page available on https://portal.mypage.com
I have it set up in a VM for testing. I point portal.mypage.com to my VM in /etc/hosts.
In VM I have haproxy forwarding https://portal.mypage.com to localhost:3000
and rewriting “/” to “/{{ tyk_dashboard_org_id }}/portal/” with “reqrep ^([^\ ])\ /(.) \1\ /{{ tyk_dashboard_org_id }}/portal/\2”.
I have set “portal_root_path”: “/” in analytics conf and “Set your portal domain” to portal.mypage.com in dashboard (This just changes the link in dashboard?).

With this set up https://portal.mypage.com I can access the page but it doesn’t load the assets:

Is there some conf I’m missing?

Imported Google Group message.
Sender:Tarmo Janson.
Date:Friday, 18 December 2015 13:20:20 UTC.

Also,
The link in dashboard is “portal.mypage.com/portal/
If I set “portal_root_path”: “/” in conf, shouldn’t it be without the “portal/”?

  • show quoted text -

Imported Google Group message.
Sender:Martin Buhr.
Date:Friday, 18 December 2015 13:49:47 UTC.

Hi Tarmo,

What you are doing here is essentially what we used to do with the host manager, proxying the portal through port 80, there’s a few rewrites you need, take a look at the nginx config template we use for portal based configs, it will show you what you need to proxy.

Here’s the relevant nginx setup:

You can see all the rewrites (there’s 3 to get it all working)

There’s another solution though, we use it in our new docker setup since it all runs on the same host and we want everythign to run on port 80, and that is have Tyk handle the proxying for you, as in the Tyk Gateway runs on port 80, then you set up the Portal as a special set of APIs in Tyk and the gateway does the same thing that you have HAProxy doing now.

It depends on what you are trying to achieve, but if you’re not wedded to HAProxy then this is the fastest thing to do, take a look here (you’ll need to figure out the bits for your config yourself):

https://tyk.io/v1.9/setup/docker/#step-3-bootstrap-your-dashboard-and-portal:69e60651f42783a7df723575c4088b5b

Here’ the setup script:

https://github.com/lonelycode/tyk_quickstart/blob/master/setup.sh#L69

The highlighted curl command is a bootstrap API command that generates the relevant proxy entries for you, you could just run this against your API

The tyk.conf and the tyk_dashboard confs are quite specific, i.e. you need to setup domain maangement a specific (open) way:

https://github.com/lonelycode/tyk_quickstart/blob/master/tyk.conf
https://github.com/lonelycode/tyk_quickstart/blob/master/tyk_analytics.conf

Cheers,
Martin

Imported Google Group message.
Sender:Tarmo Janson.
Date:Monday, 21 December 2015 12:01:27 UTC.

Without HAproxy can I have dashboard and portal also on https or only the gateway?

  • show quoted text -

Imported Google Group message.
Sender:Martin Buhr.
Date:Monday, 21 December 2015 12:37:51 UTC.

Hi Tarmo,

Yes you can, it’s in the docs: https://tyk.io/v1.9/configuration/ssl/

Thanks,
Martin