Home >Backend Development >PHP Tutorial >nginx + tomcat configuration, static resources directly use nginx myeclipse tomcat configuration tomcat download eclipse configuration tomcat

nginx + tomcat configuration, static resources directly use nginx myeclipse tomcat configuration tomcat download eclipse configuration tomcat

WBOY
WBOYOriginal
2016-07-29 08:53:431205browse

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

  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:workmy-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教程有兴趣的朋友有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn