nginx + tomcat 配置,静态资源直接使用nginx myeclipse tomcat配置 tomcat 下载 eclipse配置tomcat

php中文网
发布: 2016-07-29 08:53:43
原创
1346人浏览过

java代码  tomcat,tomcat 配置文件,linux tomcat 配置,tomcat环境变量配置,tomcat配置虚拟目录,tomcat 安装,myeclipse tomcat配置,tomcat 下载,eclipse配置tomcat

超级简历WonderCV
超级简历WonderCV

免费求职简历模版下载制作,应届生职场人必备简历制作神器

超级简历WonderCV 271
查看详情 超级简历WonderCV
  1. upstream tomcat_server {  
  2.         server 127.0.0.1:8080;  
  3.     }  
  4.       
  5.      server {  
  6.         listen       80;  
  7.         server_name  localhost;  
  8.         root  D:\work\my-project;  
  9.           
  10.         location / {  
  11.             index index.jsp;  
  12.         }  
  13.         location /j_spring_security_check {  
  14.             proxy_set_header Host $host;  
  15.             proxy_set_header X-Forwarded-For $remote_addr;  
  16.             proxy_pass http://tomcat_server;  
  17.         }  
  18.         location ~ .*\.(jsp|do)$ {            
  19.               
  20.             proxy_set_header Host $host;  
  21.             proxy_set_header X-Forwarded-For $remote_addr;  
  22.             proxy_pass http://tomcat_server;  
  23.         }  
  24.           
  25.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css|html)$ #设定访问静态文件直接读取不经过tomcat  
  26.         {  
  27.             expires      30d;  
  28.         }  
  29.         location ~ ^/(WEB-INF)/ { #这个很重要,不然用户就可以访问了  
  30.             deny all;  
  31.         }  
  32.         error_page   500 502 503 504  /50x.html;  
  33.         location = /50x.html {  
  34.             root   html;  
  35.         }  
  36.     }  

以上就介绍了nginx + tomcat 配置,静态资源直接使用nginx,包括了tomcat 配置方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号