当前位置 主页 > 服务器问题 > nginx问题汇总 >

    nginx配置文件nginx.conf中文注释说明(4)

    栏目:nginx问题汇总 时间:2018-11-22 16:13


      #所有jsp的页面均交由tomcat或resin处理
      location ~ .(jsp|jspx|do)?$ {
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_pass http://127.0.0.1:8080;
      }

      #所有静态文件由nginx直接读取不经过tomcat或resin
      location ~ .*.(htm|html|gif|jpg|jpeg|png|bmp|swf|ioc|rar|zip|txt|flv|mid|doc|ppt|pdf|xls|mp3|wma)$ {
       expires 15d;
      }
      
      location ~ .*.(js|css)?$ {
       expires 1h;
      }
     }
    }