Nginx is a reverse proxy server, it can proxy PHP, also can proxy tomcat
First, you have to install the nginx,jdk,tomcat.
The installation of Tomcat is simple and can be run by extracting it.
Then go to the directory where the Ngxin configuration file is located, mine is in/usr/local/nginx/conf
Create a profile, try to avoid modifying the original configuration file, at the time of opening using the configuration file we created can be
vim jsp.conf
The contents are as follows:
4;events{ 1024;}http{ server { 80; server_name localhost; location ~ \.jsp$ { root /usr/local/tomcat/webapps; indexindex.jsp; proxy_pass http://localhost:8080; } }}
The above configuration indicates that listening on port 80, all addresses with the end of the. JSP are forwarded to localhost:8080, which is Tomcat. Project catalog is deployed under/usr/local/tomcat/webapps
Then start Tomcat
cd /usr/local/tomcat/bin./startup.sh
Start Ngxin, using the configuration file we just created
/usr/local-c /usr/local/nginx/conf/jsp.conf
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the Linux note (--nginx) agent Tomcat, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.