Events capture does not work after reverse proxy configuration with nginx

Hi community,

I have configured my instance to collecte aggregate data and events based data. Every thing worked fine when using IP:PORT to access DHIS2. But after configuring a reverse proxy to use domain name instead of the IP. The event capture app is not working, the page is not responsive and I have the errors in the console as you can see in the attached image.
I am using the 2.30 version.

2 Likes

hello @Gerard_Bisama
Can you clear the catalina.out file with >catalina.out then clear browser catch, return to dashboard and go back to event capture app after that share the logs we start from that to resolve your problem…

2 Likes

Hi @moses_mwale,
Thanks for your availability. Find here enclosed the file catalina.out after cleaning the cache and trying to access to access to the events capture app.

Thanks,
catalina.out.doc (19.0 KB)

2 Likes

Hello @Gerard_Bisama,

After going through the catalina.out. I did not see anything useful, do you mind sharing your Nginx config files I have a look. See attached of my config which works fine. please replace your IPs with dummy ones.default.doc (1.8 KB)

Also under your Nginx config please share this error log. It can be found under this path
/var/log/nginx/error.log;
I am thinking you have a config error in your Nginx config default file.

1 Like

Hello @Gerard_Bisama,
Also, take note of the following information taken from fellow server admins.

You will need to check ssl certificate settings in Nginx proxy conf and server.xml
in DHIS2 conf file within the location section, ensure that you have
proxy_set_header X-Forwarded-Proto https;
Note the https at the end
And also in the server.xml, ensure that within the Connector tag, you have these set: proxyPort=“443” scheme=“https”
The above option works if you are using an SSL certificate (probably set using certbot —Nginx (FREE)
Otherwise, if no SSL certificate, ensure that the https becomes http in Nginx conf file
Also on server.xml, ensure that the above changes to proxyPort=“80” scheme=“http”

Please note the change in Ports

3 Likes

Hi @moses_mwale,

Thanks for your assistance, in fact in dont use ssl now, since I wanted first to ensure that everything is working.
I have attached my nginx.conf file.
And nginx.conf.doc (2.1 KB)
I have found the line below in the nginx/error.log file:
2019/11/01 10:06:36 [error] 1041#1041: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 197.157.209.26, server: dhis$
2019/11/01 10:06:56 [error] 1041#1041: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 197.157.209.26, server: dhis$
2019/11/01 10:07:01 [error] 1041#1041: *2 open() “/home/dhis/tomcat-dhis/webapps/ROOT/api/29/me.json” failed (2: No such file or directory), client: 19$
2019/11/01 10:07:29 [error] 1044#1044: *40 connect() failed (111: Connection refused) while connecting to upstream, client: 197.157.209.22, server: dhi$
2019/11/01 10:07:33 [error] 1044#1044: *42 open() “/home/dhis/tomcat-dhis/webapps/ROOT/api/30/userSettings.json” failed (2: No such file or directory),$
2019/11/01 10:07:34 [error] 1039#1039: *52 connect() failed (111: Connection refused) while connecting to upstream, client: 197.157.209.3, server: dhis$
2019/11/01 10:07:34 [error] 1044#1044: *46 open() “/home/dhis/tomcat-dhis/webapps/ROOT/api/30/systemSettings.json” failed (2: No such file or directory$
2019/11/01 10:13:52 [error] 4350#4350: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 197.157.209.54, server: dhis$
2019/11/01 10:13:52 [error] 4350#4350: *2 open() “/home/dhis/tomcat-dhis/webapps/ROOT/api/30/userSettings.json” failed (2: No such file or directory), $
2019/11/01 10:13:53 [error] 4350#4350: *2 open() “/home/dhis/tomcat-dhis/webapps/ROOT/api/30/systemSettings.json” failed (2: No such file or directory)$
2019/11/01 10:14:09 [error] 4350#4350: *2 open() “/home/dhis/tomcat-dhis/webapps/ROOT/api/30/userSettings.json” failed (2: No such file or directory), $
2019/11/01 10:14:09 [error] 4350#4350: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 197.157.209.54, server: dhis$
2019/11/01 10:14:10 [error] 4350#4350: *12 open() “/home/dhis/tomcat-dhis/webapps/ROOT/api/30/systemSettings.json” failed (2: No such file or directory$

2 Likes

Hi community,

Any idea on this post?

Thanks again.

1 Like

Sorry for the late reply, let me have a further look

1 Like