Hosting ansible tower behind nginx

I installed ansible tower on my system. I did not know that it uses port 80 and 443.

I was hosting my grafana server on my nginx. And after I installed ansible-tower, I am not able to access my grafana server, as every request goes to ansible tower.
This is what I get,

I stopped this tower service, and then tried to access my grafana. But then I get 502 error, even though my grafana and nginx are running.

I think the solution is to run nginx on some different port OR hosting ansible-tower behind nginx.

Someone has hosted ansible-tower behind nginx ? Please help me. I read the official page on reverse proxying but did not get anything.

HI @Luvpreet_Singh
The tower installation playbook change main configuration file of nginx - /etc/nginx/nginx.conf (there should be issue for this bad method of installation on ansible tower bugzilla). For multisite hosting on your server you should move this configuration to conf.d directory and specify servername for host header splitting of tower from graphana.

1 Like

Yeah I just noticed this.

I deleted all the config posted by tower as I needed to access grafana.

Is there any way of installing tower on top of nginx without changing the main file ?

Tower installer is just ansible playbook. You can change tasks that manipulate nginx config but more correct way is to create bug. But for bug we need to have redhat subscription for tower.

Do you use the tower to integrate with cloudforms?

No, I was just testing the tower for now on my localhost and some other servers and I don’t have a Red Hat subscription.

I will try to manipulate those playbooks and see if that works.

If you find any hack for this, kindly reply here.

Thanks for your response.

I have dedicated hosts for tower cluster for manageiq /cloudforms integration and when installing I only changed the configuration of rabbitmq to adjust the memory management (I change jinja2 templates for related to rabbitmq tasks). I use tower for spawn cloud instances through cloudforms.