Install dhis2 as subdomain

We have a main domain https://softlmis.com and we installed DHIS2 in the same server under docker which is accessible as http://128.199.98.99:8080/ . Then we updated NGINX configuration to run the DHIS2 instance as https://demo.softlmis.com/ , for example -

server {

server_name demo.softlmis.com; # managed by Certbot

location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection ‘upgrade’;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
#include /etc/nginx/proxy_params;
}

The DHIS2 logs in properly in subdomain, but the internal apps like pivot table, capture, maintenance - does not work at all. Everything works from the IP address.

Seems we have to do some updates in the tomcat setup. Can this really be achieved under docker, or we have to install the DHIS2 directly in the server.

Can anyone assist?

1 Like

@Mahmud ,

What kind of error are you facing when you open the apps?

Thanks,
Rithvik

1 Like

You can even check yourself if you log in to domain -

User: covax_admin
Password: x1Zcuh#rlja@sDi

When I go to Maintenance it shows blank page. When I login using IP, it works fine.

1 Like

@Mahmud ,

This issue due to misconfiguration in your nginx. The site is loading over https but the routing is happening via http and giving a mixed content error. Please follow this thread where they faced a similar issue.

Thanks,
Rithvik

2 Likes

Thanks @rithvik, we followed the instructions of the thread and now subdomain is working fine!