1. 程式人生 > >使用 nginx 代理 tomcat 服務器

使用 nginx 代理 tomcat 服務器

true webapp pos cati roo highlight flv clas pre

server
{
    listen       80;

    server_name xxx.com;

    root /usr/share/tomcat/webapps/xxx;

    error_log logs/wechat-jsp.err.log;

    location / {
        proxy_redirect off;
        proxy_pass http://127.0.0.1:8080/xxx/;
    }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp3|wma)$
    {
        expires      30d;
    }

    location ~ .*\.(js|css)$
    {
        expires      12h;
    }

}

  

使用 nginx 代理 tomcat 服務器