When setting up your On-Prem instance, it is important to follow the steps outlined Here for
"General PostgreSQL configuration steps".
However, if you do everything correctly, and in the right order, you may still land on an Nginx 404 page when attempting to login for the first time.
While there can be many reasons for this, one of the main reasons to see this is when your Postgres database is not able to connect.
The first step, after you notice this 404, is to check your Tomcat logs:
docker-compose logs iriusrisk-tomcat
You want to look towards the beginning of this file for something that mentions your database IP address. An example would be:
PSQLException: FATAL: no pg_hba.conf entry for host “X.X.X.X:5432”
Or you may notice that the port is "refused."
Lets verify that the "pg_hba.conf" file exists first, and then we can verify that the mapping is setup correctly.
For Postgres-12, your file will be in the `/etc/postgresql/12/main/` directory.
Sudo cat this file to be sure you have added the following line at the bottom of this file:
host all all 172.17.0.0/24 md5
If you have not, then go ahead and sudo vim (nano, vi...etc) this file and add this line. You also want to verify that you have the correct IP address. Do keep in mind this snippet from our docs:
"Substituting "172.17.0.0/24" with the docker network interface address where the Tomcat server will reside. If you plan to use the Tomcat in Docker option, then "172.17.0.0/24" is correct as is, since that's the address of the docker containers.
If you are unsure what your interface is or you want postgres to allow password authentication from all sources, you can use: "
host all all 0.0.0.0/0 md5
If your original error has a specific IP different than the one mentioned in our doc, be sure to make the changes needed.
Example of this would be:
PSQLException: FATAL: no pg_hba.conf entry for host “172.26.0.1:5432”
In this example, you would want your pg_hba.conf file to include:
host all all 172.26.0.0/24 md5
And as always, you can default to the `0.0.0.0/0` option and this should allow the connection.
Afterwards, be sure to restart postgres by running:
sudo systemctl restart postgresql
And be sure to restart your docker containers:
docker-compose down && docker-compose up -d
This will take about 5 minutes to load up and you should then be able to view your login by visiting your instance domain (or server name) in a local browser.
To better provide a visual for how your "pg_hba.conf" file should look, here are some examples:
"Catch All" IP:
If you are still having trouble, please feel free to Open A Support Ticket and we will be happy to take a look!