1. Install nginx and tomcat, assuming the nginx-0.7.65, tomcat6.x. Nginx can be downloaded from http://nginx.org/en/download.html.
#./Configure
# Make
# Make install
After installation, nginx is installed in the/usr/local/nginx/directory by default. The start command is/usr/local/nginx/sbin/nginx, the default configuration file is/usr/local/nginx/CONF/nginx. conf.
After installation, run the following command to check the correctness of the configuration file:
#/Usr/local/nginx/sbin/nginx-T
Run the following command to start nginx
#/Usr/local/nginx/sbin/nginx
After startup, you can access http: // localhost to check whether the installation is correct.
2. Modify the/usr/local/nginx/CONF/nginx. conf file, modify or add the "Location/" configuration.CodeThe Tomcat port is 8080.
Location/{<br/> proxy_pass http: // localhost: 8080; <br/>}
3. Restart Tomcat and nginx and access http: // localhost/examples/to view the examples application that comes with Tomcat.
References:
Http://nginx.org/en
Http://wiki.nginx.org/Main