Login error

Dear All, i have installed DHIS2 instance, in ubuntu version 20.04 lts, dhis2 version 2.34
after running tomcat i get the login image but i am unable to login

i used the below credentials
username: admin
password: district

@Gassim please help

Hi @Janise
Do you get any error message after entering the login credentials? Thank you!

i dont get any error message

Oh, then you might be facing the same issue as another user in this topic: Can't login with no error messages

Instead of merging the two topics, I will keep this topic so that if it’s a different cause, we’ll have a different solution, right? But I’ll ask you the same questions:

At this moment, @netroms suggests downloading a fresh copy of the versions of the server you are running (2.33.8) from the DHIS2 binary archives, and try to use this new instance against your existing database. Preferably on a “fresh” machine. Please let me know if this works, but do send the error log before trying this just in case if there’s a different approach.

Thank you @Janise!

This is what i get.

nginx/sites-available /default

You should look at the following URL’s in order to grasp a solid understanding

of Nginx configuration files in order to fully unleash the power of Nginx.

Getting Started | NGINX

Pitfalls and Common Mistakes | NGINX

Nginx/DirectoryStructure - Debian Wiki

In most cases, administrators will remove this file from sites-enabled/ and

leave it as reference inside of sites-available where it will continue to be

updated by the nginx packaging team.

This file will automatically load configuration files provided by other

applications, such as Drupal or Wordpress. These applications will be made

available underneath a path with that package name, such as /drupal8.

Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.

Default server configuration

server {
listen 80 default_server;
listen [::]:80 default_server;

root /home/dhis/tomcat-dhis/webapps/ROOT;

root /var/www/html/dhis;

Enables compression, incl Web API content-types

gzip on;
“application/json;charset=utf-8” application/json
“application/javascript;charset=utf-8” application/javascript text/javascript
“application/xml;charset=utf-8” application/xml text/xml
“text/css;charset=utf-8” text/css
“text/plain;charset=utf-8” text/plain;

# SSL configuration
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
# include snippets/snakeoil.conf;

root /var/www/html;

# Add index.php to the list if you are using PHP

index index.html index.htm index.nginx-debian.html;

server_name _;

#location /dhis {


proxy_redirect off;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto http;

proxy_buffer_size 128k;

proxy_buffers 8 128k;

proxy_busy_buffers_size 256k;


#location /dhis {



location /dhis {
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;



Virtual Host configuration for example.com

You can move that to a different file under sites-available/ and symlink that

to sites-enabled/ to enable it.

#server {

listen 80;

listen [::]:80;

server_name example.com;

root /var/www/example.com;

index index.html;

location / {

try_files $uri $uri/ =404;



Now when i log in i get this error

when i refresh i get this message

I see that you are experiencing an issue another user has experienced before and the solution was by @phil:

If it works please let me know; otherwise, maybe there are other changes that you need to make as well! Thank you! (:

i have done as you have instructed but still the same
sites-available 1
nginx conf2
nginx conf 1



Hey I’m sorry it didn’t work! I will ask for further support. Thanks for all the logs and screenshots! :+1:

BTW, I see in your API request:

Aren’t you forgetting to add the port number 8080 in the request URI. Isn’t it supposed to be Additionally, have you tried using a different port number for the instance?

when i use it says site cannot be found but if i use takes me to the login page

I wonder if that port is blocked. Maybe the ubuntu firewall? with tomcat running on 8080, you should be able to access provided that dhis2.war was installed at tomcats root. Logging in without nginx is the first step.

1 Like

before nginx, site was not available after installing and configure nginx site is available

Hey I have asked for support for your situation and I’d like to quote Morten Svanæs:

This case seems a bit deadlocked, it would be much easier if I could get access to the server. I can access the ip he is using

sure it will be very helpful, i can give him access

Hi @Janise can you check whether below variable is off in dhis.conf

server.https = off

If on turn it off since it looks you are using http and not https

And do restart tomcat.

1 Like

same problem appears

we did restart tomcat right after modification of dhis.conf? Can you past again the contents of dhis.conf and also tomcat logs after restart

A post was split to a new topic: DHIS2 Fundamentals course login issue