centos6.5 nginx+tomcat部署

来源:互联网 发布:渠道店面管理专员知乎 编辑:程序博客网 时间:2024/06/04 19:14

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


0 0
原创粉丝点击