server {listen 80;server_name localhost;index index.html index.htm index.jsp; #设定访问的默认首页地址root /www/demon;#设定网站的资源存放路径#charset koi8-r;#access_log logs/host.access.log main;#location / {# root html;# index index.html index.htm;#}location ~ .*.jsp$ { #所有jsp的页面均交由tomcat处理index index.jsp;proxy_pass http://localhost:8080; #转向tomcat处理}location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ #设定访问静态文件直接读取不经过tomcat{expires 30d;}location ~ .*\.(js|css)?${expires 1h;}}
编辑nginx安装目录下conf文件夹中的nginx.conf
以上就介绍了centos65 nginx+tomcat部署,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。