Host manager with Nginx

Imported Google Group message. Original thread at: Redirecting to Google Groups Import Date: 2016-01-19 21:06:02 +0000.
Sender:Rodrigo Alfaro.
Date:Thursday, 12 February 2015 20:36:42 UTC.

Hi.

I got a right Tyk and dashboard configuration with the vagrant quick-start setup; but I can’t get a right config with the host manager.

I’m configuring three Tyk process, with a Nginx as balancer and the host manager.

tyk --port 5000
tyk --port 5001
tyk --port 5002

I follow the instructions on https://tyk.io/v1.5/setup/installation-nginx/ and the HOST_MANAGER_README.md file.

sudo rm -R /etc/nginx/sites-available
sudo ln -s nginx_confs /etc/nginx/sites-available

I have Nginx with the right configuration, but the host manager refuse to manage Nginx, it output this log message:

sudo ./tyk-host-manager

INFO[0000] Loading configuration
INFO[0000] Connecting to Redis
INFO[0000] Connecting to redis on: localhost:6379
INFO[0000] Connecting to Mongo
INFO[0000] Loading templates
INFO[0000] getTemplates took 986.057µs
INFO[0000] Syncronising active API configurations
INFO[0000] GetApiHashes took 116.07µs
INFO[0000] Found New API’s: 1
INFO[0000] Updated APi’s: 0
INFO[0000] Removed APi’s: 0
INFO[0000] NGinX Not managed, skipping file writes
INFO[0000] tyk.cluster.notifications: subscribe 1

I tried with nginx running, running as sudo and stopped too. The command ‘sudo service nginx restart’ runs fine.

I attached all the configs.

I don’t know what’s wrong :frowning:

Imported Google Group message.
Sender:Martin Buhr.
Date:Thursday, 12 February 2015 20:48:08 UTC.

Hi Rodrigo,

You’re not doing anything wrong, you’re just missing a setting (that obviously must have been missed out in the included host manager configuration file - shame on us).

Add this line to your host_manager.conf:

{
“mongo_url”: “mongodb://localhost/tyk_analytics”,
“redis_port”: 6379,
“redis_host”: “localhost”,
“redis_password”: “test”,
“tyk_ports”: [5000,5001,5002],
“tyk_secret”: “352d20ee67be67f6340b4c0605b044b7”,
“license_owner”: “Your Name”,
“manage_nginx”: true
}

And voilà! It will start to manage the NGinX configurations :slight_smile:

Thanks,
Martin

  • show quoted text -