Linux » NGINX


Last modified by Administrator on 30-03-2012

To add nginx yum repository, create a file named /etc/yum.repos.d/nginx.repo and paste one of the configurations below:


name=nginx repo

yum install nginx

chkconfig --add nginx

chkconfig --levels 235 nginx on
service nginx start

Nginx proxying for Tomcat applications

As Tomcat is not a true web server, it's worth to use it as backend. Nginx is one of the best solutions for the frontend web server.

So, after typical XWiki installation we have XWiki running on http://localhost:8080/xwiki. Most probably, we want access XWiki via on standard 80 port. Tuning Nginx will give us desired result:

  • create file /etc/nginx/conf.d/tomcat.conf
  • put following code inside:

    server {
        listen       80;
    # Root to the XWiki application
        root  opt/tomcat/webapps/xwiki;

        location / {
    #All "root" requests will have /xwiki appended AND redirected to again
            rewrite ^ $scheme://$server_name/xwiki$request_uri? permanent;

        location ^~ /xwiki {
    # If path starts with /xwiki - then redirect to backend: XWiki application in Tomcat
           proxy_pass http://localhost:8080/xwiki;


  • restart nginx

Now all* requests will lead to XWiki application. Please note, that these settings are basic, for more flexible solutions refer to Nginx documentation

Created by Administrator on 29-09-2012


 | Arduino | Blog | Dashboard | Java | Linux | Main | MulltiWii | NEAX2000 | Radio | VOIP

This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 3.5 - Documentation