Ganib behind nginx server

3,202 views

Ganib with nGinx


  • Add the below text to nginx configuration file. (replace server name with your domain name)
upstream playtah {
   server localhost:8080;
}

server {
    listen       80;
    server_name  www.ganib.com ganib.com;

    location /nginx_status {
        stub_status on;
        access_log   off;
        allow 127.0.0.1;
        deny all;
        }

    location / {
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_pass http://playtah;
        proxy_set_header  x-real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}
  • Edit GANIB_HOME/tomcat/conf/server.xml and add below lines

<Host name="www.ganib.com" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="" docBase="ganib" /> </host>

  • Restart nginx server & tomcat server.

 

asked Aug 6, 2013 by Emily S (820 points)

Please log in or register to answer this question.

...