Hello community,
Am working on the deployment of dhis2 on a cloud server and am using docker, so i want to have nginx so that can act as a single request point that forwards request to dhis2 service but i have been facing error of redirecting because dhis2 redirects, so how can i handle this errors, i have tried many troubleshoot like setting server.base.url in dhis.conf:" DHIS2 configuration file
Database connection
connection.dialect = org.hibernate.dialect.PostgreSQLDialect
connection.driver_class = org.postgresql.Driver
connection.url = jdbc:postgresql://dhis2db:5432/dhis2
connection.username = ****
connection.password = ****
Server settings
server.base.url = http://localhost/dhis2
System settings
system.session.timeout = 3600
system.monitoring.provider = prometheus
system.sql.init = false
system.startup.failure.is.fatal = false
File store configuration
filestore.provider = filesystem
filestore.container = files", nginx default.conf:" # DHIS2 configuration
location /dhis2/ {
proxy_pass http://dhis2/;
proxy_redirect off;
# DHIS2 specific timeouts
proxy_read_timeout 600;
# Additional DHIS2 headers
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 $scheme;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_http_version 1.1;
# Cache configuration for static content
location ~* ^/dhis2/.*\.(js|css|png|jpg|jpeg|gif|ico)$ {
proxy_pass http://dhis2;
expires 24h;
add_header Cache-Control "public, no-transform";
}
}" but none of this troubleshoot has worked out