← Back to team overview

dhis2-users team mailing list archive

nginx Reverse Proxy Config for Dedicated Web Server with multiple instances

 

Hello all,

 

I am trying to set up nginx as a reverse proxy on a dedicated web server
with three instances of Tomcat/DHIS2 (connecting to a dedicated Db Server,
successfully configured and checked).

I have been unable to make nginx behave as required, after numerous
different configurations, and hours of trawling the 'Net.

 

Attempting to following the instructions on dhis2.org resulted in bind
errors ([emerg] bind() to 0.0.0.0:80 failed (98: address already in use)),
and after several variations I tried setting up a simple reverse proxy
following the instructions on howtoforge.com at this link
<http://www.howtoforge.com/how-to-set-up-nginx-as-a-reverse-proxy-for-apache
2-on-ubuntu-12.04> .  I now have arrived at the same place, albeit by a
slightly different path, and am getting those bind errors again.  I have
even shut down all three Tomcats and removed and purged Apache (in case it
was somehow interfering, which it apparently is not).

 

The domain dhmis.org has a DNS entry for dhis, za.dhis and train.dhis
pointing to the server's IP.

My current configuration includes a file in /etc/nginx/site-available called
"dhmis.org.vhost", which is linked to the ./sites-enabled folder.  Herewith
its contents:

 

server {

        listen 80;

        server_name www.dhmis.org dhmis.org; # Have put in za.dhis.dhmis.org
and variations here.

        root /home/hisp/tomcat-dhis2-1/webapps/zanat/; # Have tried ROOT
here too!

 

        # Serve static content

        location ~
(\.js$|\.css$|\.gif$|\.woff$|\.ttf$|\.eot$|\.ico$|^/images/|^/icons/|^/dhis-
web-commons/.*\.png$) {

        add_header  Cache-Control  public;

        expires  7d;

        }

 

        # Proxy pass to servlet container

 

        location / {

                proxy_pass http://localhost:8080/; # Have added 8080/zanat
as variations here.

                include /etc/nginx/proxy_params;

        }

}

 

What am I doing wrong?

 

Kind regards,

Jason Phillips

 



Software & Information Systems

Health Information Systems Programme

-----------------------------------------------------
Email:         <mailto:jason@xxxxxxxx> jason@xxxxxxxx

Mobile  :   072 9737250
Landline:  021 7120170
Fax:           021 7120170
Skype:      jason.n.phillips

 

This message may contain privileged and confidential information intended
only for the person or entity to which it is addressed. Any review,
retransmission, dissemination, copy or other use of, or taking of any action
in reliance upon this information by persons or entities other than the
intended recipient, is prohibited. If you received this message in error,
please notify the sender immediately by e-mail, facsimile or telephone and
thereafter delete the material from any computer. Any views expressed in
this message are those of the individual sender, except where the sender
specifically states them to be the view of the entity transmitting the
message.

 



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

PNG image


Follow ups